Skip to content

Commit 9c79158

Browse files
yphojuliomotol-hdmd
authored andcommitted
Added multiselect (with checkboxes) for bootstrap4/5
1 parent 64b41dc commit 9c79158

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@foreach($filter->options() as $k => $value)
2+
<div class="form-check">
3+
<input
4+
class="form-check-input"
5+
onclick="event.stopPropagation();"
6+
type="checkbox"
7+
id="filter-{{$key}}-{{ $loop->index }}"
8+
wire:model="filters.{{$key}}.{{ $loop->index }}"
9+
value="{{ $k }}"
10+
>
11+
<label class="form-check-label" for="filter-{{$key}}-{{ $loop->index }}">{{ $value }}</label>
12+
</div>
13+
@endforeach

resources/views/bootstrap-4/includes/filters.blade.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ class="dropdown-menu w-100 mt-md-3"
3838

3939
@if ($filter->isSelect())
4040
@include('livewire-tables::bootstrap-4.includes.filter-type-select')
41+
@elseif($filter->isMultiSelect())
42+
@include('livewire-tables::bootstrap-4.includes.filter-type-multiselect')
4143
@elseif($filter->isDate())
4244
@include('livewire-tables::bootstrap-4.includes.filter-type-date')
4345
@endif
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@foreach($filter->options() as $k => $value)
2+
<div class="form-check">
3+
<input
4+
onclick="event.stopPropagation();"
5+
type="checkbox"
6+
id="filter-{{$key}}-{{ $loop->index }}"
7+
wire:model="filters.{{$key}}.{{ $loop->index }}"
8+
value="{{ $k }}"
9+
>
10+
<label class="form-check-label" for="filter-{{$key}}-{{ $loop->index }}">{{ $value }}</label>
11+
</div>
12+
@endforeach

resources/views/bootstrap-5/includes/filters.blade.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ class="dropdown-menu w-100"
3838

3939
@if ($filter->isSelect())
4040
@include('livewire-tables::bootstrap-5.includes.filter-type-select')
41+
@elseif($filter->isMultiSelect())
42+
@include('livewire-tables::bootstrap-5.includes.filter-type-multiselect')
4143
@elseif($filter->isDate())
4244
@include('livewire-tables::bootstrap-5.includes.filter-type-date')
4345
@endif

0 commit comments

Comments
 (0)