我有一个模态弹出窗口,以Ajax格式显示。它包括Bootstrap-Multiselect表单。问题是Dropdown无法打开选择列表。我尝试了很多选项,包括破坏,刷新,但它不起作用。
$(document).on('click', '.edit-modal', function(e){
e.preventDefault();
var parts = this.id.split("-"); //Split block
var string = parts[parts.length - 1]; //receive last
var myData = 'modal_show='+ string; //receive data for POST
jQuery.ajax({
type: "POST",
url: "../ajax/modal.php",
dataType:"text",
data:myData,
success:function(response){
$("#all-modal").html(response);
$('#physical-modal, #modal-overlay').css({'display':'block'});
$('.smart-multiselect').multiselect('destroy');
$('.smart-multiselect').multiselect({nonSelectedText: 'Select optional'});
},
error:function (xhr, ajaxOptions, thrownError){
alert(thrownError);
}
})
})