Repository navigation
Open
Labels
enhancementNew feature or request
Milestone
Description
Problem
The DataTable MVP (#161) shows all rows passed in. For tables of more than a few dozen rows, users need a way to narrow the visible set — search by free text, filter by column value, or both.
Impact
- Without built-in filtering, consumers either pre-filter
rowsupstream (acceptable but pushes UI state into the consumer) or wire their own filter UI per use case (drift across apps). - Filter state in an editable table requires the same edit reconciliation work as sort — edits to a hidden row must persist when the filter changes.
Suggested Approach
Two complementary mechanisms:
interface IDataTableProps<T> {
// controlled filter — parent decides which rows are visible
filter?: (row: T) => boolean;
// built-in free-text search across configured columns
searchableColumns?: (keyof T)[];
searchQuery?: string;
onSearchQueryChange?: (query: string) => void;
}filter: an arbitrary predicate the parent provides; DataTable uses it to determine which rows to render. Fully controlled.searchableColumns+searchQuery: built-in free-text search box rendered in the toolbar that matches any of the listed columns case-insensitively. Optional convenience for the most common case; consumers wanting custom filter UI can usefilterdirectly.- Hidden rows do not lose their underlying record identity —
rowKeycontinues to track them; edits in flight survive filter changes. - Filter affects display only;
onSavereceives the full row set including filtered-out rows (consumer can reduce upstream if needed).
Context
Layered on top of #161 (DataTable MVP). Independent of sorting (#167) and pagination (#169).
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
[-]DataTable: row filtering[/-][+]Table: row filtering[/+]