Topic: Re-Initialize a Select field
dan1
pro
asked 10 years ago
Wouter
pro
answered 9 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 free commented 9 years ago
Thanks for finding solution to this issueWouter pro commented 9 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();
ijabit
free
answered 10 years ago
LexBel
free
answered 10 years ago
Michal Szymanski
staff
answered 10 years ago
Daniel
pro
answered 10 years ago
Michal Szymanski
staff
answered 10 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>
dan1
pro
answered 10 years ago
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Pro
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No