refine icon indicating copy to clipboard operation
refine copied to clipboard

[FEAT] Create/Edit buttons: pass field value and redirect parameters

Open manosbatsis opened this issue 1 year ago • 6 comments

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:

  1. Set the value for a form field using the filter (for create)
  2. 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:

  1. The button's meta (e.g. for create) could allow setting initial values to the create/edit forms
  2. The useForm.redirect could allow applying the previous filters, taken from either the button's meta or history

manosbatsis avatar Nov 20 '23 09:11 manosbatsis

Hello @manosbatsis thanks for the feat request!

For now, you can achieve a similar behavior by utilizing useParsed and useGo hooks.

BatuhanW avatar Nov 21 '23 07:11 BatuhanW

@manosbatsis is this issue still open?

Ishpreet01 avatar Jan 18 '24 19:01 Ishpreet01

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 avatar Jan 22 '24 13:01 manosbatsis

@manosbatsis hey, is this issue resolved? if not I am ready to work on it. can you please assign it.

Abhishek-5854 avatar Feb 25 '24 16:02 Abhishek-5854

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.

manosbatsis avatar Feb 25 '24 17:02 manosbatsis

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.

stale[bot] avatar Apr 25 '24 18:04 stale[bot]