javascript - jquery数据表: page length select list not shown

标签 javascript jquery datatables

我正在使用 JQuery 数据表:1.10.7 和 https://datatables.net/reference/option/lengthMenu

JS代码:

      $('.table').dataTable({ 
'lengthMenu': [ [10, 25, 50, -1], [10, 25, 50, 'All'] ], 
'aoColumns': [null, null, null, { 'bSortable': false }, { 'bSortable': false }] }); // eslint-disable-line new-cap

输出: enter image description here

但我需要以下列表来设置页面长度:

enter image description here

怎么办?有什么遗漏吗?

更新

输出html:

<div id="DataTables_Table_0_length" class="dataTables_length">
   <label>
      Show 
      <select class="" aria-controls="DataTables_Table_0" name="DataTables_Table_0_length">
         <option value="10">10</option>
         <option value="25">25</option>
         <option value="50">50</option>
         <option value="-1">All</option>
      </select>
      entries
   </label>
</div>

但根本没有显示。

更新

原因是:

.dataTables_length {
        display: none;
}

最佳答案

使用下面的 dom 值,

dom: 'Blfrtip',

关于javascript - jquery数据表: page length select list not shown,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36703093/

相关文章:

javascript - 从嵌套回调函数中提取返回值

javascript - cordova/phonegap 阻止并允许后退按钮

javascript - 选中单选按钮时,如何从 span 中获取 Apple?查询

jquery - 选择后更改复选框并勾选颜色

jquery - 数据表 - 是否可以在不破坏过滤器的情况下重新加载/重绘表?

php - 将特定行的数据传递给模态(laravel 数据表插件)

javascript - 使用 Get Time Javascript 更改样式 CSS

javascript - 使用 css3 过渡字体大小和边距顶部

jQueryRotate - IE8 中的问题

javascript - datatables不加载json(带有对象的数组)