refine
refine copied to clipboard
[FEAT]: prepopulate initialValues in searchFormProps when syncWithLocation is true
Is your feature request related to a problem? Please describe. I am setting syncWithLocation to true for useTable from Antd, the initialValues in searchFormProps is empty
Describe the solution you'd like Automatically populate initialValues in searchFormProps when syncWithLocation is true
Where this method is located in this repo @mayank-meragi ?
@vinayjain18 https://github.com/pankod/refine/blob/next/packages/antd/src/hooks/table/useTable/useTable.ts
@omeraplak can I work on this one?
@omeraplak can I work on this one?
Yes! Happy hacking 💥
@omeraplak can you provide more details to me or explain more about the issue?
Hey @toukirkhan ,
The useTable hook allows filtering with an external form. You can view an example here. https://example.admin.refine.dev/orders?pageSize=10¤t=1
When syncWithLocation is enabled in useTable, all filters start to sync with the URL, so when you share this link with someone else, the filters are applied to that client as well.
For example, when you enter this URL, pay attention to the filter form. You will see the filters in the URL come as initialValue.
https://example.admin.refine.dev/orders?pageSize=10¤t=1&filters[0][field]=q&filters[0][operator]=eq&filters[0][ value]=test&filters[1][field]=store.id&filters[1][operator]=eq&filters[1][value]=1&filters[2][field]=status.text&filters[2][operator]=in&filters[2 ][value][0]=Pending
The way to achieve this is to write the following lines, https://github.com/pankod/refine/blob/next/examples/fineFoods/admin/antd/src/pages/orders/list.tsx#L291
What is desired with this feature is that this process takes place automatically without the need to write these lines. Is everything clear to you?
@omeraplak yeah I got it!!
@omeraplak am unassigning myself as I am not able to create the output required over here. Thank you!
I want to work on it. Please assign it to me
I want to work on it. Please assign it to me
Done! Happy hacking! 🚀
Hey @Mohammad-Palla , Any updates on this issue?
Unassigned this issue from @Mohammad-Palla due to inactivity. If anyone interested in this issue, please leave a comment 🚀
@omeraplak @aliemir
Please help to review PR https://github.com/refinedev/refine/pull/2988 for this issue.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.