I'm need al selected rows livewire-tabels #1805
Replies: 4 comments 2 replies
-
What're you trying to achieve? Do you want to just get a list of Models that have been selected? Or something more? |
Beta Was this translation helpful? Give feedback.
-
I need the selected models to filter them based on an attribute and then pass the list of filtered ids to a modal that needs to do some processing on the models that have certain characteristics. In short, I would like to avoid passing all the selected ones but only those that have a certain attribute, I am migrating all my datatables from livewire-datatables to your livewire-tablee. |
Beta Was this translation helpful? Give feedback.
-
So I'm at version 2 because my software is laravel 9 livewire 2 and livewire-datatables and I'm migrating to your great extension of very complex tables to play all the things I had on the old extension. So I need to reproduce all the features I had and this is one that I can't make work as I need as I need to have the data of the selected rows and do some checks first to avoid passing too much data to the modal that has to use the data for other things. I specify that I do this migration precisely in order to then migrate laravel to version 11, livewire at 3 and yours at 3 but I can't do otherwise before I have to have everything ready and compatible. |
Beta Was this translation helpful? Give feedback.
-
Ok thanks, in fact I had already done as you advised on Bulk-Action me I just wanted to optimize as I had done previously by doing a check before passing the ids in modal form, this was possible because in that datable there is a function that provides me with all the data of the rows selected as I thought the one mentioned by you would do: $this->selectedRowsQuery() //recupero degli ids degli shipments con allegati selezionati nell'ordine di visualizzazione al momento della richiesta
$selected = $this->getExportResultsSet()->filter(function ($row) {
return $row['callback_attachments_count'] > 0;
})->map(function ($printable) {
return $printable['Id'];
})->toArray();
$this->emit('showMassPrint', $selected); here $row ['callback_attachments_count'] is the filter I want to apply to filter the ids before sending them to modal and the function that provides me with the selected data which also includes the attribute to filter with is $this->getExportResultsSet(). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm need al selected rows data but not exist on livewire-tables 2 $this->selectedRowsQuery()->get(), how can I do it?
Beta Was this translation helpful? Give feedback.
All reactions