aware-green
aware-green11mo ago

initial filter

is there any way to get a permenantly filtered list from useDataGidProps
2 Replies
kapa.ai
kapa.ai11mo ago
Hi @alfaz_muhammed. 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 get a permanently filtered list from useDataGrid by using the filters.permanent property. This property sets the permanent value of the filter, which is unchangeable and will not be cleared when the user changes the filter. Here is an example of how to use it:
useDataGrid({
filters: {
permanent: [
{
field: "name",
operator: "contains",
value: "Foo",
},
],
},
});
useDataGrid({
filters: {
permanent: [
{
field: "name",
operator: "contains",
value: "Foo",
},
],
},
});
In this example, the list will be permanently filtered to contain only the items where the name field contains the value "Foo". For more information, you can refer to the CrudFilters interface in the Refine documentation (https://refine.dev/docs/api-reference/core/interfaceReferences/#crudfilters). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai11mo ago
<@763439201353596968> kapa.ai is still learning and improving, please let us how it did by reacting below