#Pre-select records on the table

2 messages · Page 1 of 1 (latest)

nocturne skiff
#

I am trying to find a way how can I select records on backend?

A bit of context. I need a way to export specific records. Potentially I can just write custom action that would accept csv file with "specific" records and generate export file.
But this is very niche solution.
I would rather create an action that would accept file and as a result it would select those specific items.
Then we can use any bulk action, such as export, delete, whatever.

Here is my test action

Action::make('preselect_items')
                    ->icon(Heroicon::OutlinedFire)
                    ->label('Preselect Items')
                    ->color('gray')
                    ->action(function (ListProducts $livewire) {
                        $livewire->selectedTableRecords = ['53862'];

I can see that selected records coming back in livewire update ajax, but table is not selecting them.

Is there a way to "reload" table UI to select those items?

Thanks!

tribal sealBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution