Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc] Fix <TreeWithDetails filter> doc chapter #10406

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs/TreeWithDetails.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,17 +245,18 @@ If you want to allow user to reorder nodes in the tree, simply add the `draggabl
export const CategoriesList = () => <TreeWithDetails draggable />;
```


### `filter`
## `filter`

You can choose to permanently filter the tree to display only a sub tree.

For instance, imagine you have one `employees` resource with a `department` field, and you want to display a tree for the Finance department. Use the `filter` prop to filter the tree:

{% raw %}

```jsx
const EmployeeList = () => <TreeWithDetails filter={{ department: 'finance' }} />;
```

{% endraw %}

**Note**: This only works if the filter field allows to extract a subtree with its own root node. If you use the `filter` prop to display a sparse selection of nodes (e.g. only the `male` employees), dragging nodes in this tree will not work as expected.
Expand Down
Loading