Skip to content

A way to get the data filtered by column filters and global filter separately. #4670

Closed Answered by MAST1999
MAST1999 asked this question in Ideas
Discussion options

You must be logged in to vote

Hey everyone

Just wanted to give an update since the latest table release we can do this much more elegantly using table features.

Note that most of this code is copied from the internal implementation of getFilteredRowModel.
After defining this, you can pass it to the table like this: _features: [TablePreGlobalFilteringFeature]

Then you'll have access to getPreGlobalFiltering on the table instance.

import {
  createRow,
  getMemoOptions,
  memo,
  ResolvedColumnFilter,
  Row,
  RowData,
  RowModel,
  Table,
  TableFeature,
} from '@tanstack/react-table';

export interface TablePreGlobalFilter<TData> {
  getPreGlobalFiltering: () => RowModel<TData>;
}

export const TablePreGlobalFiltering…

Replies: 5 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@MAST1999
Comment options

Comment options

You must be logged in to vote
2 replies
@MAST1999
Comment options

@SStranks
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by MAST1999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
6 participants