Topic: material select / dropdown issue
Brecht Richard pro asked 9 years ago
$("#periode").change(function () {
$.ajax({
type: 'POST',
url: '@Url.Action("GetKampenVanPeriode")',
dataType: 'json',
data: { id: $("#periode").val() },
success: function (kampen) {
$("#kampen").empty();
$.each(kampen, function (i, kamp) {
$("#kampen").append('<option value="'
+ kamp.Value + '">' +
kamp.Text + '</option>');
});
},
error: function (ex) {
alert('Error!: ' + ex);
}
});
return false;
"#periode" is the first dropdown. When the selection changes, the "#kampen" options are filled .
Quite straight forward, but don't understand why it isn't working with the material select.
Anyone that could help? Or I'm I just stuck with the browser-default? Michal Szymanski staff pro premium priority answered 9 years ago
$('select').material_select('destroy');
Brecht Richard pro answered 9 years ago
Michal Szymanski staff pro premium priority answered 9 years ago
ijabit answered 9 years ago
Michal Szymanski staff pro premium priority answered 9 years ago
Ian Morris answered 6 years ago
$(document).ready()
$.get("views/funcs/get-cust-list.php", function(data){ var o = $.parseJSON(data); $.each(o.custLookup, function(custName, arr){ var val = parseInt(arr.id); var name = custName; var activeCheck; $("#cust_id").append('<option value="'+val+'" '+activeCheck+'>'+name+'</option>'); }); $('.mdb-select').material_select(); }); <select class="mdb-select colorful-select dropdown-primary" id="cust_id"> <option value="0" selected="" hidden="">Select A Client: </option> </select>
Sebastian Kaczmarek staff pro premium commented 6 years ago
Indeed, there was a bug in the old 4.5.7 version. In 4.5.9 version we have rewritten the Material Select from scratch and all the issues have been addressed. However, in the 4.5.9 version, there is a nasty bug which has been fixed in the latest 4.5.10 version. So my suggestion is to use the latest MDB 4.5.10FREE 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