Topic: Re-Initialize a Select field
Wouter pro answered 7 years ago
[EDIT]
You need reintialize your .mdb-select items. I tried calling it scoped to the wrapping div of the html returned, but that doesnt work.
THIS DOESNT WORK!
function OnAjaxComplete(e) { $('.async-wrapper .mdb-select').material_select() }
THIS DOES:
function OnAjaxComplete(e) { $('.mdb-select').material_select('destroy'); $('.mdb-select').material_select(); }
Adrian Sawicki commented 7 years ago
Thanks for finding solution to this issueWouter pro commented 7 years ago
@Adrian Sawicki, dont say : "Thanks finding a solution if the code is wrong, check your comment..." Calling ".material_select()" doesnt do it. you need destroy all : ('.mdb-select').material_select('destroy') and reinit all: $('.mdb-select').material_select();dan1 pro answered 9 years ago
Michal Szymanski staff pro premium priority answered 9 years ago
<label>Browser Select</label>
<select class="browser-default">
<option value="" disabled selected>Choose your option</option>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
</select>
Daniel pro answered 9 years ago
Michal Szymanski staff pro premium priority answered 9 years ago
LexBel answered 8 years ago
ijabit answered 8 years ago
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No