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
toeknee
toekneeβ€’4mo ago
$this->table->getSelectedTableRecords() maybe?
TheBrewSensei
TheBrewSenseiOPβ€’4mo ago
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
toeknee
toekneeβ€’4mo ago
Yeah thats what I was trying to get the table, not too sure personally as I haven't done it yet.
Roncarino
Roncarinoβ€’3mo ago
Hi @n0nsensei ! How have you achieved a selectable table? πŸ€”
krekas
krekasβ€’3mo ago
not possible
TheBrewSensei
TheBrewSenseiOPβ€’3mo ago
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
Dennis Koch
Dennis Kochβ€’3mo ago
Yes, selection happens on client side only.
TheBrewSensei
TheBrewSenseiOPβ€’3mo ago
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. πŸ‘Œ
dvarilek
dvarilekβ€’3mo ago
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 though
TheBrewSensei
TheBrewSenseiOPβ€’3mo ago
nice, thanks for the tip

Did you find this page helpful?