我遇到了在Bootbox.dialog后面显示的jquery自动完成问题 我在schedulinging.js中显示bootbox.dialog然后在部分我将自动完成附加到视图上的控件。我一直在阅读不使用Jquery 1.10的Z-index,但不确定如何在对话框之后将dom中的自动完成功能放到正确的位置。无论如何我无法让Z-index工作。需要一些帮助才能使这个工作。谢谢!
bootbox.dialog({
message: result,
buttons: {
save: {
label: "Save",
className: "btn-primary btn-xs",
callback: function () {
var $form = $('#form');
//Validating the form using unobtrusive validation.
$.validator.unobtrusive.parse($form);
$("#form").validate();
if ($("#form").valid()) {
$.ajax({
cache: false,
$('#ScheduleItem_AdditionalDescription').autocomplete({
source: function (request, response) {
var searchTerm = $('#ScheduleItem_AdditionalDescription').val();
//Ajax call to retrieve the potiential auto complate results
//based on the searchTemer that are passed in through the additional
//description control.
window.suppressBlockUI = true;
$.ajax({
url: "/ScheduleDetail/AutoCompleteAdditionalDesc",
dataType: "json",
contentType: 'application/json, charset=utf-8',
data: {
term: searchTerm
},
success: function (data) {
window.suppressBlockUI = false;
response($.map(data, function (item) {
return {
label: item.AdditionalDescription
//,
//value: item
};
}));
}
});
}, minLength: 1,
select: function (event, ui) {
},
open: function () {
$(this).removeClass("ui-corner-all").addClass("ui-corner-top");
},
close: function () {
$(this).removeClass("ui-corner-top").addClass("ui-corner-all");
}
});
答案 0 :(得分:1)
将z-index属性设置为99999,以便它将出现