Выпадающий список с множественным выбором Select2 в LiveWire не работает ⇐ Php
-
Anonymous
Выпадающий список с множественным выбором Select2 в LiveWire не работает
I'm having a problem in making the multi-select dropdown of select2 work in my livewire code. In my code, there are radio buttons where a user will select either of those and then a dropdown will appear. Here are my codes.
DynamicERequestButton.php code:
public $selectedRadioButton = ''; public function showDropdown($type) { $this->selectedRadioButton = $type; } public function render() { return view('livewire.dynamic-e-request-button'); } dynamic-e-request-button.blade.php code: Machinery Facility Tools @if ($selectedRadioButton === 'Machinery') Machinery Type 4 Wheel Drive Tractor Rice Combine Harvester Hand Tractor with Accessories Hauling Truck Precision Seeder Pump and Engine Set Recirculating Dryer Riding-Type Transplanter Seed Cleaner Compact Ricemill Walk-Behind Transplanter Rice Thresher Seed Spreader @elseif ($selectedRadioButton === 'Facility') Facility Type Inspire RPC Warehouse @elseif ($selectedRadioButton === 'Tools') Tool Type Shovel Rake Sickle @endif I did some troubleshooting and I found out that I've made it work if I remove the dropdowns inside the if statement. But I need them to be inside the if statement because that was the purpose of the radio buttons.
Источник: https://stackoverflow.com/questions/781 ... ot-working
I'm having a problem in making the multi-select dropdown of select2 work in my livewire code. In my code, there are radio buttons where a user will select either of those and then a dropdown will appear. Here are my codes.
DynamicERequestButton.php code:
public $selectedRadioButton = ''; public function showDropdown($type) { $this->selectedRadioButton = $type; } public function render() { return view('livewire.dynamic-e-request-button'); } dynamic-e-request-button.blade.php code: Machinery Facility Tools @if ($selectedRadioButton === 'Machinery') Machinery Type 4 Wheel Drive Tractor Rice Combine Harvester Hand Tractor with Accessories Hauling Truck Precision Seeder Pump and Engine Set Recirculating Dryer Riding-Type Transplanter Seed Cleaner Compact Ricemill Walk-Behind Transplanter Rice Thresher Seed Spreader @elseif ($selectedRadioButton === 'Facility') Facility Type Inspire RPC Warehouse @elseif ($selectedRadioButton === 'Tools') Tool Type Shovel Rake Sickle @endif I did some troubleshooting and I found out that I've made it work if I remove the dropdowns inside the if statement. But I need them to be inside the if statement because that was the purpose of the radio buttons.
Источник: https://stackoverflow.com/questions/781 ... ot-working
Мобильная версия