API / Plugins / Base / Filtering / Quick Filter
QuickFilterPlugin
The QuickFilterPlugin from @omnigrid/quick-filter-plugin mounts a global search input into a grid slot (default top) and filters rows across all searchable columns on top of the core quick filter engine (grid.setQuickFilter). Input changes are debounced (default 150 ms) and the query is split into comma-separated terms — a row matches if any term is found in any searchable column. Columns marked with searchable: false are excluded, and valueGetter results are evaluated when present.
Constructor
new QuickFilterPlugin<T>(options?: QuickFilterPluginOptions)Options
Properties accepted by QuickFilterPluginOptions.
| Property | Description |
|---|---|
debounceMs numberdefault: 150 | Debounce duration in milliseconds before input changes are submitted to the grid. |
slot QuickFilterSlotNamedefault: "top" | Target slot to mount the quick filter input. Supports "top", "bottom", "down", "bodyTop", and "bodyBottom". |
position SlotPositiondefault: "start" | Alignment position of the control within the target slot. |
priority numberdefault: 0 | Render priority within the slot (lower values render first). |
placeholder stringdefault: "Search..." | Placeholder text displayed inside the search input. |
ariaLabel stringdefault: "Quick filter" | Accessible label for the input element. |
initialValue stringdefault: "" | Initial quick filter query string applied when the plugin is registered. |
Instance methods
register(api): () => voidRegisters the plugin with the grid instance, mounting the quick filter text input into the configured slot and connecting event handlers.
describe(api?): UIInputControlGenerates a declarative UI text input descriptor representing the quick filter control. Exposed so slot managers, adapters, or external containers can render the control directly.
setQuery(query): voidImmediately sets the quick filter query string on the grid.
setQueryDebounced(query): voidSets the quick filter query string after the configured debounce interval.
getQuery(): stringReturns the current quick filter query string.
clear(): voidClears the current quick filter query string.
parseTerms(query): string[]Splits a quick filter query into trimmed, non-empty, case-insensitive terms separated by commas.
matchesRow(row, terms, columns): booleanEvaluates whether a row matches search terms across all searchable columns. Ignores columns with `searchable: false` and evaluates `valueGetter` when present.
filter(data, query, columns): T[]Filters a dataset according to a quick filter query string and column definitions.
matchesRow(row, terms, columns?): booleanEvaluates whether a row matches search terms using the instance's grid columns.
filter(data, query?, columns?): T[]Filters a dataset using the instance's active query and columns.
Types and Interfaces
QuickFilterSlotNameSlots where the quick filter control can be mounted.
type QuickFilterSlotName = "top" | "bottom" | "down";