【发布时间】:2017-11-29 19:06:38
【问题描述】:
我需要使用此数据响应在“Empresa”ajax 响应之后重新创建“Local”中的多选。我将信息放在“Local”选择中,但无法重新创建“Local”多选。
$.ajax({
url: '/ajaxrequests/requestlocals',
type: 'POST', dataType: 'json',
data: {empresas:empresas},
success: function(retorno){
console.log(retorno);
$('#ajax_local').html("");
$.each(retorno, function (valor, chave) {
$('#ajax_local').append($('<option>', {
value: valor,
text : chave
}));
});
$('#ajax_local').multiselect();
}
});
【问题讨论】:
标签: javascript jquery multi-select bootstrap-multiselect