laravel livewire select2 multi select

Solutions on MaxInterview for laravel livewire select2 multi select by the best coders in the world

showing results for - "laravel livewire select2 multi select"
Antonio
09 Nov 2018
1######## INSIDE LIVEWIRE COMPONENT
2public array $locationUsers = [];
3protected $listeners = ['locationUsersSelected'];
4
5public function locationUsersSelected($locationUsersValues)
6{
7  $this->locationUsers = $locationUsersValues;
8}
9
10######## INSIDE LIVEWIRE BLADE
11<div class="col-md-12 mb-3" wire:ignore>
12	<label for="locationUsers">Select Users</label>
13	<select id="locationUsers" class="form-control select2" multiple="multiple">
14		<option value="">--select--</option>
15        @foreach($this->users as $id => $name)
16        	<option value="{{ $id }}">{{ $name }}</option>
17        @endforeach
18	</select>
19</div>
20
21######## INSIDE LIVEWIRE SCRIPTS
22document.addEventListener('livewire:load', function () {
23  $('#locationUsers').on('select2:select', (e) => {
24    @this.emit('locationUsersSelected', $('#locationUsers').select2('val'));
25  });
26
27  $('#locationUsers').val(@this.get('locationUsers')).trigger('change');
28});
queries leading to this page
select2 livewire resultslaravel livewire bind multiple selectlaravel livewire multiple selectlivewire multiselect dropdownlivewire select2 set multiple dataselect2 in livewiremulti select options livewirelivewire select2 multiple selectlivewire select 2 5cmultiple select with livewire laraveluse select 2 in livewirelivewire use select2livewire select2multiple select livewiremultiple select component livewireselect multiple livewireuse select2 livewirelaravel livewire multiselect form componentswire model multiple select livewire using select 2livewire select2 multiplemultiple select options livewirelivewire multiple select fieldmulti select livewireselect 2 livewirelaravel livewire select2laravel livewire select2 multiplehow to use select 2 in livewiremultiple select with livewiremulti select component livewirelaravel multi select livewirelivewire multi selectselect2 livewire ajaxmultiple select2 with livewireselect 2 for livewirelivewire select2 exampleselect2 with livewirelaravel livewire select2 multi selectmulti level select livewiremultiple selection select in livewiremultiple selection select in livewire use select2 with livewiremulti selected dropdown using livewirelivewire select multiplemulti select dropdown livewire componentselect2 multiple select livewirelivewire multi select dropdownlaravel select2 livewire componenthow to select multiple option in livewire laravel8dynamic select2 laravel livewireselect2 livewireselect2 laravel livewireselect2 laravel livewire databasemultiple select in livewireselect multiple not working livewire select2multiple select dropdown in livewirelivewire select2laravel livewire dynamic dropdown select2select 2 with livewirelivewire multiple selectlivewire with select2laravel livewire select2 multi select