繁体   English   中英

ColVis选择出现在Bootstrap模态背后

[英]ColVis Selection Appears Behind Bootstrap Modal

我有与此处提出的相同的问题:

jQuery Datatables jQuery模式对话框后面的列列表呈现

我在Bootstrap模式窗口中有一个DataTables表,我试图使用DataTables的ColVis扩展来使列可选。 当我单击模式上可见的“显示列”按钮时,不会显示任何内容。 但是,当我关闭模态时,我找到列列表,其中每个列的复选框都位于模态后面。

ColVis选择面板需要在模态顶部可见,并且需要与模态一起进行。

我在文件ColVis.css中的三个位置更改了z-index属性,每个都乘以因子10:

div.ColVis_collectionBackground {
    background-color: black;
    /*z-index: 1100;*/
    z-index: 11000;
}

div.ColVis_collection {
    position: relative;
    width: 150px;
    background-color: #f3f3f3;
    padding: 3px;
    border: 1px solid #ccc;
    /*z-index: 1102;*/
    z-index: 11020
}

div.ColVis_collection button.ColVis_Button {
    background-color: white;
    width: 100%;
    float: none;
    margin-bottom: 2px;
}

div.ColVis_catcher {
    position: absolute;
    /*z-index: 1101;*/
    z-index: 11010;
}

(原始值已注释掉。)

这些改动似乎对我来说足够了,但没有效果。 Bootstrap模式的z-index值可在名为bootstrap.css的文件中找到。 这是班级:

.modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1040;
  display: none;
  overflow: auto;
  overflow-y: scroll;
}

有谁知道我需要做什么?

这是一个z索引顺序问题。旧的colVis扩展名已退役,请尝试使用按钮扩展名的colVis,如果问题仍然存在,请在css中使用以下代码:

 .dt-button-background {
   z-index: 1 !important;
  }
 .dt-button-collection {
   z-index: 2 !important;
  }   

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM