rare-sapphire
rare-sapphire2y ago

initialValues empty in serachFormProps with syncWithLocation set to True

Hi, I am setting syncWithLocation to true for useTable from Antd, the initialValues in searchFormProps is empty, but I am expecting the previously used value to be present there. Any help would be appreciated. Thanks
7 Replies
rare-sapphire
rare-sapphire2y ago
I am doing really good, thanks to Refine making my life easier, hope you are doing good as well 😄 yes it would be really convenient if this could be done automatically
Omer
Omer2y ago
Thanks! Could you create a feature request? (https://github.com/pankod/refine/issues/new?assignees=&labels=enhancement&template=feature_request.md&title=%5BFEAT%5D) I'm sure there will be a community member who wants to do it at the Hacktoberfest (https://hacktoberfest.com/) event 🚀
rare-sapphire
rare-sapphire2y ago
done, thank you
Omer
Omer2y ago
Thank you! Don't forget to support us by giving stars hehe 🤣
xenial-black
xenial-black15mo ago
Hey @Omer , I noticed that the Issue created from this wasn't resolved but closed due to staleness. Issue link: https://github.com/refinedev/refine/issues/2624 I'm trying to implement what you did inside of https://github.com/refinedev/refine/blob/next/examples/finefoods-antd/src/pages/orders/list.tsx#L57 using the initialValues Prop as done here https://github.com/refinedev/refine/blob/next/examples/finefoods-antd/src/pages/orders/list.tsx#L308 but I can't get it to work. Apart from this stuff, is there anything else to remember or take care of? The documentation could be improved in that regard, as this is pretty default behavior IMHO. Link to the docs: https://refine.dev/docs/api-reference/antd/hooks/table/useTable/#search Got it! You have to pass the operator of the filter that you want to display like: getDefaultFilter('name', filters, 'contains') This seems to me like a flaw inside of getDefaultFilter . Plus the Naming of the function should rather be getDefaultFilterValue 🤔 .
Omer
Omer15mo ago
Definitely a much better naming! Would you like to create a PR? 👀