ramonrietdijk / livewire-tables

Dynamic tables for models with Laravel Livewire
https://livewire-tables.ramonrietdijk.nl/
MIT License
195 stars 10 forks source link

Idea: Addable, Editable, Deletable #49

Closed KenKodz closed 1 year ago

KenKodz commented 1 year ago

You're on a roll, so I thought I throw this out there. This is such a big ask, that I am not even requesting the feature, merely putting it out there into the ether.

For Addable, I am envisioning a button in the bar that would show when protected bool $addable = true;. This button would show a modal that contains fields for all the Columns and would have Add and Cancel buttons.

For Editable, I'm thinking having protected bool $editable = true; show an edit icon in an actions column that would make each of the columns change into fields and the edit icon would change into a save button. Alternatively, it could show a modal like Addable.

For Deletable, it'd simply have protected bool $deleteable = true; show a trash icon in the actions column that would have a confirmation before deleting the row.

I am thinking about working on this myself, but you've been so quick and elegant with the updates, I'd hate to waste time building it differently than you'd do it. :-)

ramonrietdijk commented 1 year ago

Hi @KenKodz,

Thanks for sharing your thoughts!

Although I like your idea, I'm afraid it's a bit outside of the scope of this package. I'm mainly focused on the table itself and making it as easy as possible to interact with. Actions can be implemented to alter data by the user, but updating or deleting records directly within the package is something I'm currently not planning to add. Having a "crud" on top of the table would introduce quite some complexity. Of course, feel free to implement these functionalities by yourself. Any custom settings you may need in your columns can be passed via metadata.

Hope you understand!