Open snapey opened 4 years ago
I created a workaround in the updatedCheckboxAll()
by including the paginator. Might be useful to someone...
public function updatedCheckboxAll()
{
$this->checkbox_values = [];
if ($this->checkbox_all) {
$this->models()->paginate($this->per_page)->each(function ($model) {
$this->checkbox_values[] = (string) $model->{$this->checkbox_attribute};
});
}
}
In other places where I check-all, I expect the operation to be limited to those in view.
The action of checking all causes every model to be deleted, not just those visible on page1
I extended the warning message to indicate this, but I think the default behaviour should be to only select the models on view.
I also overrode the
updatedSearch()
function so that it clears previous checkbox selection when making a new search so that items not in view are not accidentally deleted.