feat(toolbar-search): support auto-filterable rows (#1179)

Closes #591
This commit is contained in:
metonym 2022-03-19 12:01:03 -07:00 committed by GitHub
commit 2df7b92269
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 218 additions and 25 deletions

View file

@ -464,6 +464,22 @@ title="Load balancers" description="Your organization's active load balancers."
</Toolbar>
</DataTable>
### Filterable
By default, `ToolbarSearch` will not filter `DataTable` rows.
Set `shouldFilterRows` to `true` to enable client-side filtering. The default filtering performs a basic string comparison on cell values that are of a string or a number type.
Note that in-memory filtering is not optimal for large data sets, where you might consider using server-side search.
<FileSource src="/framed/DataTable/DataTableFilterable" />
### Filterable (custom)
`shouldFilterRows` also accepts a function and passes it the current row and value. It expects the function to return a boolean.
<FileSource src="/framed/DataTable/DataTableFilterCustom" />
### Zebra stripes
<DataTable zebra