Select2在引导弹出窗口窗体上不起作用? [英] Select2 doesn't work on bootstrap popover form?
问题描述
我有一个table
,每行td
包含大约30个td
我打开一个弹出窗口,在其中显示我的表单,因为我想显示它们为哪个td
输入值,所以我有选择使用引导弹出窗口,
I have a table
one row contains around 30 td
for each td
I open a popover where I will be showing my form because I want to show for which td
they enter the values so I have chosen to use bootstrap popover,
我对弹出式窗体上的所有select
字段都使用select2
.像这样
I use select2
for all the select
field on popover form. Like this,
$(".select2").select2({
width: '100%',
});
但这似乎不起作用. select2
被应用,但option
根本没有打开.
But this doesn't seems to be working. select2
gets applied but option
is not opening at all.
我也像这样重新初始化select2
,
I also reinitialised the select2
like this,
$('body').on('shown.bs.popover', function (e) {
$(".select2").select2("destroy").select2();
});
但仍然是同一问题.
FIDDLE
谢谢.
推荐答案
我认为确实显示了select2选项,但它出现在弹出容器的后面.
也许您可以尝试如下更改select2 z-index
:
I think select2 option did show, but it appeared behind popover container.
Maybe you can try to change select2 z-index
like below:
.select2-dropdown {
z-index: 9001; //or try higher
}
这篇关于Select2在引导弹出窗口窗体上不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!