Any way to get table selected records outside the table function in a custom page
Hi guys, i have a custom page with table and forms, the table is selectable, i need to get the selected records outside of the table function in another function in the custom page. i tried $this->getSelectedTableRecords() but returns empty always, is it even possible?
10 Replies
$this->table->getSelectedTableRecords() maybe?
not working either, it seems getselectdtablerecors is in the hastable triat itself so it would be in the livewire component context right? selected records is availabel inside the table header actions and bulk action but i just cant seems to access it from outside the table instance
Yeah thats what I was trying to get the table, not too sure personally as I haven't done it yet.
Hi @n0nsensei ! How have you achieved a selectable table? π€
not possible
sadly no, i just used the table header action for now, i wish this is possible since combining form with table will be pretty powerful. i searched for the select events hoping i will be able to catch the data in livewire but didnt find any, may be its purely js side, will have to dig deeper
Yes, selection happens on client side only.
Thanks for the response. Will it be possible to implement feature like this in the future as we can use the table outiside of filamentphp panel, I use it in a livewire page to let user filter out employees and then select to exclude or include, but i have the main logic outisde the table where i want to process the selected records. By the way, big fan of filamentphp, been using it in many production apps now, its awesome. π
It's possible in v4 by entangling selected records using
currentSelectionLivewireProperty
on the table, no easy way to do that in v3 as far as I know thoughnice, thanks for the tip