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
continuing-cyan
continuing-cyanOP3y 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
Omer3y 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 🚀
continuing-cyan
continuing-cyanOP3y ago
done, thank you
Omer
Omer3y ago
Thank you! Don't forget to support us by giving stars hehe 🤣
ambitious-aqua
ambitious-aqua2y 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
Omer2y ago
Definitely a much better naming! Would you like to create a PR? 👀

Did you find this page helpful?