AngularJS 有显示长度但没有分页的数据表

AngularJS Datatables with display length but without pagination

我正在与 angular-datatables 合作。

我的最终目标是 table 没有分页,但 "link" 允许 "show 25 more entries" (并且不使用 select 长度“10” 、“25”、“50”、“100”等)。

所以首先,我将显示长度设置为 25:

this.dtOptions = DTOptionsBuilder.newOptions()
    .withBootstrap()
    .withDisplayLength(25)

太棒了,我的 table 只显示了 25 个带分页的五个条目。 不,我尝试使用 :

禁用分页
this.dtOptions = DTOptionsBuilder.newOptions()
   .withBootstrap()
   .withDisplayLength(25)
   .withOption('paging', false)

然后分页被禁用,但 table 显示超过 25 个条目。
我明白这是一种逻辑,否则将无法访问这 25 个以上的条目,但这正是我想要实现的目标。

谢谢

我会在 table 完成渲染后简单地隐藏注入的分页元素:

.withOption('drawCallback', function() {
   $('.dataTables_paginate').hide()
})

.dataTables_paginate 是总体 <div> dataTables 放置分页控件的地方,如果有的话。