自动完成出现在模态弹出窗口后面 [英] Auto complete Appearing behind the Modal popup
本文介绍了自动完成出现在模态弹出窗口后面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用 jQuery 自动完成 的简单 jquery 弹出窗口和自动完成.自动完成的代码是像这样的东西.
I am using simple jquery popup and Auto complete of jQuery Auto complete .The code of Auto complete is something like this.
$("#tags").autocomplete({
source: NameArray
});
其中tags是文本框id,NameArray是字符串数组.但是Modal弹出窗口中的这段代码是这样的-
where tags is the textbox id and NameArray is Array of string.However this code in the Modal pop-up like this-
function openFilterPopUp() {
$("#tags").autocomplete({
source: NameArray
});
$("#openFilterPopUp").dialog({
resizable: false,
height: 240,
modal: true,
buttons: {
"ok": function() { $(this).dialog("close"); },
Cancel: function() { $(this).dialog("close"); }
}
});
}
自动完成的数据显示正常,但出现在弹出窗口后面.请帮助.任何帮助将不胜感激.
The data for Autocomplete is appearing fine but its appearing behind the popup.Please Help. Any help will be appreciated.
推荐答案
添加自动完成的appendTo属性
Add appendTo property of autocomplete
$("#tags").autocomplete({
source: NameArray,
appendTo : _parentElement
});
_parentElement 可以是你的模态主体
_parentElement can be your modal body
这篇关于自动完成出现在模态弹出窗口后面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文