angular - 如何更新 ng2-smart-table 中的分页操作

标签 angular ng2-smart-table

在 Angular 应用程序中,我使用了 ng2-smart-table。我已经启用了分页。但它显示正常的外观。我没有使用默认外观,而是使用带有页面选项的下拉菜单。

<select>
  <option>5</option>
  <option>10</option>   
  <option>15</option>
</select>

我也设置了更改事件。

问题:

1) 如何更新 ng2-smart-table 以根据值更改设置页面大小。

2) 我也想在特定页面上移动。例如:表有 1000 条数据,每个寻呼机有 10 条记录。所以我只想在 14 的页面上。那么,我该怎么做呢?

为此,我引用了它的文档,但我没有得到任何事件。

最佳答案

更新每页值。

this.DataSource.getPaging().perPage = event.target.value;

要设置特定页面,您必须使用 setPage()

this.DataSource.setPage(3); // Pass page number

它对我来说很好用。有关详细信息示例,请参阅此 link.

关于angular - 如何更新 ng2-smart-table 中的分页操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52287870/

相关文章:

javascript - ng2-smart-table 删除后不绑定(bind)

当表单域处于事件状态时,Angular Material 表单域轮廓输入颜色会发生变化

angular - 如何更改 ng2 智能表列宽?

javascript - 错误类型错误 : Converting circular structure to JSON --> starting at object with constructor 'FirebaseAppImpl' Firebase Angular

css - Angular ngStyle - 绑定(bind)动态和静态 css 属性

angularjs - Angular 2通过服务器API加载数据: data.切片错误

angular - ng2-smart-table自定义渲染组件

angular - 当用户单击 ng2-smart-table 中的 'add new' 时禁用单元格

angular - Angular 为 6 的 Material 步进器不起作用 [在 browser.js 中找不到动画方法]

html - 并排对齐div - Angular