flat-fuchsia
flat-fuchsia•14mo ago

Is it possible to avoid generating the filter query string when there are filters for tables/lists?

Hello! I'm trying to create a filter component for my tables and list but I would like to avoid also generating the query string attached to the url when i execute the query with new filters. Is it possible to disable this behaviour? Thanks! 🙂
3 Replies
kapa.ai
kapa.ai•14mo ago
Hi @fatrex. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Yes, you can disable the syncing of the filter state with the URL by setting the syncWithLocation property to false when using the useTable or useDataGrid hooks. Here's an example for both hooks: For useTable with Ant Design:
useTable({
refineCoreProps: {
syncWithLocation: false,
},
});
useTable({
refineCoreProps: {
syncWithLocation: false,
},
});
For useDataGrid with Material UI:
useDataGrid({
syncWithLocation: false,
});
useDataGrid({
syncWithLocation: false,
});
By setting syncWithLocation to false, the filter state will not be synced with the URL, and the query string will not be generated when you apply new filters. Source: React Table - syncWithLocation (https://refine.dev/docs/packages/documentation/react-table#syncwithlocation) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai•14mo ago
<@473207105231257610> kapa.ai is still learning and improving, please let us how it did by reacting below
flat-fuchsia
flat-fuchsia•14mo ago