如何在bootstrap表中更改page-size的默认值?

use*_*426 3 jquery bootstrap-table

我正在使用这个引导表 http://wenzhixin.net.cn/p/bootstrap-table/docs/examples.html#client-side-pagination-table

它的默认页面大小为10.如何在加载网格时将其更改为5或任何内容.

它提供了选择它的选项,data-page-list="[5,10]"但默认情况下在加载时保持10.

Gur*_*Rao 9

你可以使用喜欢的页面pageSize属性bootstrap table

$('#table-javascript').bootstrapTable({
                cache: false,
                height: 400,
                striped: true,
                pagination: true,
                pageSize: 5, //specify 5 here
                pageList: [5, 10, 25, 50, 100, 200]//list can be specified here
});
Run Code Online (Sandbox Code Playgroud)

阅读文档

  • 只需将 `data-page-size='25'` 添加到您的 <table> 中 (2认同)