refine
refine copied to clipboard
[FEAT] Create/Edit buttons: pass field value and redirect parameters
Is your feature request related to a problem? Please describe.
Consider a link to set filters for my list view as follows:
<Link to={`/posts?filters[0][field]=category.id&filters[0][operator]=eq&filters[0][value]=${row.id}`}>
{filteredPosts?.length}
</Link>
This works for my list view by simply adding:
const { dataGridProps } = useDataGrid<IPost>({
syncWithLocation: true,
})
Now I would like to use the CreateButton/EditButton in the same list view to:
- Set the value for a form field using the filter (for create)
- Redirect to the list view after save, using the same filters
Describe alternatives you've considered
Alternatives for this functionality are unclear.
Additional context
No response
Describe the thing to improve
Perhaps:
- The button's meta (e.g. for create) could allow setting initial values to the create/edit forms
- The useForm.redirect could allow applying the previous filters, taken from either the button's meta or history
Hello @manosbatsis thanks for the feat request!
For now, you can achieve a similar behavior by utilizing useParsed and useGo hooks.
@manosbatsis is this issue still open?
Yeah, guess so. Never managed to do this; even if a workaround/alternative way is possible as suggested by @BatuhanW, users like me would need a relevant howto to get it working.
@manosbatsis hey, is this issue resolved? if not I am ready to work on it. can you please assign it.
Hi @Abhishek-5854 thanks for stepping up. Don't have the rights to assign you the ticket, but I'm pretty sure project admins would happily review a PR for it.
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.