Capítulo 36 de 54
globalFilteringFeature (built on columnFilteringFeature) is a single cross-column filter value against one globalFilterFn — narrower in scope than column filtering (12 built-in functions vs. 18, no range-comparison-heavy variants) but otherwise the same registration/state/control patterns.
tableFeatures({ columnFilteringFeature, globalFilteringFeature, filteredRowModel: createFilteredRowModel(), filterFns: {...} }) for client-side; manualFiltering: true and skip the row model for server-side (same trade-offs as column filtering — see Client-Side vs Server-Side Guide).globalFilterFn (table option, not per-column) selects the comparator — a registered string name or a function passed directly. 12 built-in options: string (includesString, includesStringSensitive, equalsString), equality (equals, weakEquals), array-valued (arrIncludes, arrIncludesAll, arrIncludesSome, arrHas), ranges (inNumberRange, between, betweenInclusive) — notably no startsWith/endsWith/inDateRange/empty/notEmpty (those are column-filtering-only).globalFilter is a single value (typed any so custom functions can use non-string shapes, but usually a search string). Reactive read: table.state.globalFilter; snapshot: table.atoms.globalFilter.get(). Ownership: external atom (v9-recommended) via atoms.globalFilter, or classic state.globalFilter + onGlobalFilterChange, or initialState.globalFilter alone — never mix initialState with a controlled value for the same slice.<input> to table.state.globalFilter / table.setGlobalFilter(value).enableGlobalFilter: false (excludes that column from the global search — check via column.getCanGlobalFilter()), or table-wide enableGlobalFilter: false; enableFilters: false disables both column and global filtering at once.table.setGlobalFilter(value), table.resetGlobalFilter() / resetGlobalFilter(true), table.getGlobalFilterFn() (current comparator), table.getGlobalAutoFilterFn() (the default — currently includesString), column.getCanGlobalFilter().globalFilterFn in practice — covered in its own chapter since it needs filterMeta and a paired sort function to be genuinely useful.const features = tableFeatures({
columnFilteringFeature, globalFilteringFeature,
filteredRowModel: createFilteredRowModel(),
filterFns: { includesString: filterFn_includesString },
})
const table = useTable({ features, columns, data, globalFilterFn: 'includesString' })
<input value={table.state.globalFilter ?? ''} onChange={(e) => table.setGlobalFilter(e.target.value)} placeholder="Search..." />
table.state.globalFilter, write via table.setGlobalFilter.startsWith/date ranges/emptiness checks globally.<input> yourself; nothing renders automatically.enableGlobalFilter: false per-column is how you exclude a field (like an internal id) from cross-table search without affecting its own column filter.globalFilterFn for approximate/ranked search.manualFiltering and the page-reset caveat, identical to column filtering's.