我试图隐藏“FilterBatch”选择输入元素,但没有任何反应。窗口打开后仍会显示选择 html 输入。我还尝试从 click 事件中调用 Hide() 。这是示例代码:
var modalRerunConfirmDialog = $("<div id=\"modalRerunConfirmDialog\"/>").dialog({
modal: true,
autoOpen: false,
title: "UDS Dashboard - Rerun jobs",
resizable: false,
draggable: false,
dialogClass: "dialogOverride",
buttons: {
Yes: function () {
$("#modalRerunConfirmDialog").dialog("close");
//do something
},
No: function () {
$(this).dialog("close");
}
},
width: 550
});
var msg = Array();
msg[msg.length] = "<br><br><div style=\"font-size:2.0em\">Filter Your Selection</div>";
msg[msg.length] = "<br/><div><select id=\"FilterBatch\" style=\"width:500px;\"></select></div>";
modalRerunConfirmDialog.html(msg.join(" "));
//Bind the Select Box to the Multiselect jQuery plugin
$("#FilterBatch").multiselect({
noneSelectedText: "Select Batch",
selectedList: 1,
multiple: false,
click: function (event, ui) {
FilterBatch_Change(ui.value); <= == I also tried to call.Hide() here !! !
}
});
//populate the first dropdown box inside the modal window
$.each(arrayIDs, function (index, value) {
$('#FilterBatch').append($('<option>', {
value: value,
text: value
}));
});
$('#FilterBatch').multiselect("refresh");
//hide the select html element <=== this is not working !!!
$("#FilterBatch").hide();
modalRerunConfirmDialog.dialog("open");
谢谢