How to navigate to a list page with filter parameters?

I want to navigate to a list page using a filter parameters from where I came on the edit page. After I edit a data I will be redirected to a list page with the default filters, but if there is a way to navigate back with the same filters settings it would be nice. For example I go to edit page from the list page as
http://localhost:3000/schedules/lists?pageSize=10&current=1&sorter[0][field]=id&sorter[0][order]=desc&filters[0][field]=date&filters[0][operator]=eq&filters[0][value]=2023-02-26
http://localhost:3000/schedules/lists?pageSize=10&current=1&sorter[0][field]=id&sorter[0][order]=desc&filters[0][field]=date&filters[0][operator]=eq&filters[0][value]=2023-02-26
And once I complete the edit and save the form I will be redirected to
http://localhost:3000/schedules/lists?pageSize=10&current=1&sorter[0][field]=id&sorter[0][order]=desc&filters[0][field]=date&filters[0][operator]=eq&filters[0][value]=2023-02-27
http://localhost:3000/schedules/lists?pageSize=10&current=1&sorter[0][field]=id&sorter[0][order]=desc&filters[0][field]=date&filters[0][operator]=eq&filters[0][value]=2023-02-27
6 Replies
refine-support-bot
Hi, I am refine support bot :wave:. I am here to help you with your question. I searched for the answer to your question in the refine documentation and found an answer! 🏆
Answer: You can navigate to the list page with the same filter parameters by using the URL from where you came on the edit page. SOURCES: ./docs/tutorial/4-adding-crud-pages/mantine/add-edit-page.md, ./docs/tutorial/4-adding-crud-pages/mui/add-edit-page.md, ./docs/tutorial/4-adding-crud-pages/headless/add-list-page.md, ./docs/getting-started/quickstart.md

Note: If this is the answer you need, then we are very lucky. If not, please wait for someone from the refine core team or the community to try to help you.
rare-sapphire
rare-sapphire2y ago
Hey @dipbazz, unfortunately, it's not possible atm. However, you can set redirect: false and handle redirection manually.
rare-sapphire
rare-sapphire2y ago
useForm | refine
useForm is a hook that allows to manage forms. It has some action methods that create, edit and clone the form. The hook return value comes to according to the called action and it can run different logic depending on the action.
exotic-emerald
exotic-emerald2y ago
Hey @batuhanw, are you guys planning anything about this feature? I think that would be a nice to have feature.
rare-sapphire
rare-sapphire2y ago
Hello @dipbazz, thank you for thoughtful suggestions, we are about to release refine v4, it will be easier to manage this kind of cases. Let's stay in touch 🎉
exotic-emerald
exotic-emerald2y ago
Waiting for the v4 release to check the new features @batuhanw .