Topic: Re-Initialize a Select field
dan1 pro asked 8 years ago
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 free 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();ijabit free answered 8 years ago
LexBel free answered 8 years ago
Michal Szymanski staff answered 8 years ago
Daniel pro answered 8 years ago
Michal Szymanski staff answered 8 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 8 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