shadcn-table icon indicating copy to clipboard operation
shadcn-table copied to clipboard

how to use Global filter

Open thearith-dfh opened this issue 11 months ago • 3 comments

thearith-dfh avatar Mar 25 '24 09:03 thearith-dfh

by adding this:

const [globalFilter, setGlobalFilter] = React.useState(null);

const table = useReactTable({
 ...
  onGlobalFilterChange: setGlobalFilter,
 ...
  state: {
    globalFilter,
  },
});

yasseralsaidi avatar Mar 28 '24 07:03 yasseralsaidi

Uou can check the TanStackTable documentation, it is very complete, I leave you the link: https://tanstack.com/table/v8/docs/api/features/global-filtering

matcastaneda avatar Apr 01 '24 23:04 matcastaneda

Filtering that many columns server side might not be a good approach.

Maybe it should be used on the client side.

You can follow the example, and docs provided above to get started.

sadmann7 avatar Apr 02 '24 00:04 sadmann7