我在 Bootbox.dialog 后面显示 jquery 自动完成时遇到问题我在 scheduling.js 中显示 bootbox.dialog 然后在部分中我将自动完成附加到视图上的控件。我一直在阅读不要在 Jquery 1.10 中使用 Z 索引,但不确定如何在对话框后的正确位置获得 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");
}
});