notchris / payload-table-field

A table field (React Table) for Payload
https://payloadcms.com/
MIT License
11 stars 0 forks source link

Manipulating the Table: Adding/Removing/Reordering row(s) #2

Open msherman32 opened 1 month ago

msherman32 commented 1 month ago

Hello!

I am testing out this package for my application, but I do not see any way in the UI to add, remove, or reorder individual or multiple rows dynamically. I inspected the source code and did not see a way to do this.

Am I missing something obvious? @notchris I assume you didn't go through the trouble of creating this awesome package without the intention to perform additions/deletions/reorders of rows.

Screenshot 2024-07-22 at 3 20 05 PM
notchris commented 1 month ago

Hey @msherman32 - I can add row deletion to the row select feature, I'll have some time in the next few days. React table also has a row order example, it adds a (small) dependency for drag and drop, but it's pretty sleek.

msherman32 commented 1 month ago

Thanks for the quick reply!

Row deletion would be terrific. Is there already an ability to add rows to underlying React table data (this is the biggest use case I have)?

I will inspect React table's reordering ability

notchris commented 1 month ago

@msherman32 React table does have that - you can delete rows by manipulating the data object / filtering out the ones you dont want in setData. It's a bit odd, but totally do-able. This issue is on my radar, hoping to get it resolved in the next few days.

msherman32 commented 1 month ago

@notchris Any update on this?

notchris commented 1 month ago

@msherman32 I'm still working on it - I've made a branch with my progress which has row deletion working. I'll try to get some more work in this week :)

https://github.com/notchris/payload-table-field/tree/row-deletion