mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
feat(toolbar-search): add filteredRowIds
prop to support pagination (#1454)
Closes #1393 * feat(toolbar-search): add `filteredRowIds` prop * Run "yarn build:docs" * test(data-table): assert `filteredRowIds` prop * docs(data-table): add pagination to default filterable examples
This commit is contained in:
parent
2d99fe45c0
commit
dbe33d5cbb
8 changed files with 69 additions and 30 deletions
|
@ -505,13 +505,15 @@ 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.
|
||||
|
||||
To use filtering with pagination, bind to the `filteredRowIds` prop and pass its length to `totalItems` in `Pagination`.
|
||||
|
||||
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.
|
||||
`shouldFilterRows` also accepts a function and passes it the current row and search value. It expects the function to return a boolean.
|
||||
|
||||
<FileSource src="/framed/DataTable/DataTableFilterCustom" />
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue