简体   繁体   English

可滚动数据表底部的下拉菜单增加了单击的额外空间

[英]Dropdown on bottom of scrollable datatable adds extra space on click

When combining a scrollable datatable and a bootstraps dropdown, clicking a dropdown on bottom of table adds additional white space to the scroll from the popup. 当将可滚动数据表和引导程序下拉列表结合使用时,单击表底部的下拉列表可为弹出窗口中的滚动添加额外的空格。 I want the dropdown not to added space to the scroll and instead have it appear out of the table. 我希望下拉列表不要在滚动条上增加空间,而应该在表外显示。 Do you have any ideas on this problem. 您对此问题有任何想法吗? (it also occurred in boostrap calendar / selectpicker) (这也发生在boostrap日历/ selectpicker中)

The only answer I found is to use dropup 我发现的唯一答案是使用dropup

here is sample code JSFIDDLE (click dropdown in the bottom of table) 这是示例代码JSFIDDLE(单击表格底部的下拉列表)

$(document).ready(function() {
$('#test_Table').DataTable( {
    "scrollY":        "200px",
    "scrollCollapse": true,
    "paging":         false
} );

} ); });

jsfiddle Code jsfiddle代码

Use the dropup class for the bottom button so that when you click on drop down the menu comes on top. 使用下拉菜单的底部按钮类,以便在单击下拉菜单时位于顶部。

JSFIDDLE https://jsfiddle.net/p4j824p0/ JSFIDDLE https://jsfiddle.net/p4j824p0/

<div class="btn-group dropup"> 
   <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
     Action <span class="caret"></span>
   </button>
    .
    .
    .
</div>

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

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