Closed
Description
opened on Oct 6, 2024
I have a table that loops over some items, and I want to have some checkboxes to perform some bulk actions:
@foreach($items as $item)
<flux:row>
<flux:cell>
<flux:checkbox wire:model="selectedItems" value="{{ $item->id }}"/>
</flux:cell>
</flux:row>
@endforeach
The above does not work, the below however, does work:
@foreach($items as $item)
<flux:row>
<flux:cell>
<input type="checkbox" wire:model="selectedItems" value="{{ $item->id }}"/>
</flux:cell>
</flux:row>
@endforeach
I have a button somewhere:
<flux:button wire:click="bulk">Bulk actions</flux:button>
And in my component:
public $selectedItems = [];
public function bulk()
{
dd($this->selectedItems); // With the flux checkboxes this shows "true" instead of an array of selected id's
}
Why doesn't this work with Flux checkboxes? Am I missing something? I cannot put these checkboxes inside a <flux:checkbox.group>
Metadata
Assignees
Labels
No labels
Activity