Set initial filtering / sorting #10
-
Is is possible to preset the data table with initial filtering and sorting configuration? |
Beta Was this translation helpful? Give feedback.
Answered by
KevinVandy
Jun 30, 2022
Replies: 1 comment 2 replies
-
Yes! Check out the https://www.material-react-table.com/docs/api/state-options You probably want something like this <MaterialReactTable
initialState={{
columnFilters: [{ id: 'lastName', value: "Johnson" }],
sorting: [{ id: 'firstName', desc: false }],
}}
/> |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
KevinVandy
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes! Check out the
initalState
prop. You can find all of the state options that you can specify in this table from the docshttps://www.material-react-table.com/docs/api/state-options
You probably want something like this