Hide Column but keep Filter #3398
Unanswered
bitttttten
asked this question in
Q&A
Replies: 1 comment
-
Yes, there is.. add the column to initialState > hiddenColumns at useTable props, and you still can setFilter to this column: const {
getTableProps,
getTableBodyProps,
headerGroups,
rows,
prepareRow,
setFilter,
} = useTable<ColumnsProps>(
{
columns,
data,
initialState: {
hiddenColumns: ['ACTIVE'],
filters: [{ id: 'ACTIVE', value: 1 }],
},
},
useFilters,
useSortBy,
); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a use case where I want to hide the column, but keep the filter.
In the following sandbox, you can hide and show the filters (like "age" or "first name") and see the filters disappear too: https://codesandbox.io/s/strange-northcutt-mydce?file=/src/App.js
Is there an option to hide the column but keep the filter? So I still want to hide the age column, but let people filter by age still.
Beta Was this translation helpful? Give feedback.
All reactions