sadmann7 / shadcn-table

A shadcn table component with server-side sorting, filtering, and pagination.

Home Page:https://table.sadmn.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to use Global filter

thearith-dfh opened this issue · comments

by adding this:

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

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

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

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.