i'm using jquery and jquery seletric plugin and it works fine but i need to refill options data after an ajax call.
$('#mySelectID').empty();
$.each(myResultAjaxObject, function(i, item) {
$('#mySelectID').append($('<option>', {
value: myValue,
text: imyTextValue
}));
});
$('#mySelectID').selectpicker('refresh');
This code run for multiple drop-down list and it fills them correctly, the wrong thing is that mark as selected the first child of each drop-down list.
Probably i'm missing something in the selectpicker update procedure.
Any help would be appreciated.
Davide