Clickable row add to bulk select
Alright this is super hacky but I haven't found a better way yet (feel free to point and laugh π). Looking for some advise cause eventually I'd like to reference the selected rows to update a widget values. (I opened a separate help post about that one)
My goal was to change the default behavior on a table row so that when clicked, it simply selects it to be used for a bulk action instead of opening view/edit, etc.
Here's where it runs a bit astray. I'm sure there's some method to do this with alpine/livewire, what have you - direct in the Resource, but I wasn't able to figure it out. I instead created a new JS asset, imported in a provider as follows:
custom.js
It does work, mostly. Sometimes I'm not able to click them anymore when using table search for example, suspecting the DOM is updated and not reattaching this. Either way, this doesn't feel ideal - any suggestions or insight on a better way to obtain this same behavior?
1 Reply
updated it a bit to handle the 'select all' in the bulk column. Dispatched to livewire directly. Still very hacky -- wish filamentphp fired off an event when something is selected instead.