【问题标题】:How to change default value of page-size in bootstrap table?如何更改引导表中页面大小的默认值?
【发布时间】:2015-09-13 01:05:37
【问题描述】:

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

默认页面大小为 10。如何在加载网格时将其更改为 5 或任何值。

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

【问题讨论】:

  • 只需将 data-page-size='25' 添加到您的

标签: jquery bootstrap-table


【解决方案1】:

你可以使用bootstrap table的页面pageSize属性点赞

$('#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
});

阅读Docs

【讨论】:

【解决方案2】:

只有 html,使用 data-page-size=5http://jsfiddle.net/ThePhi/pamsqcea/

【讨论】:

    【解决方案3】:

    您可以在表格标签中使用 data-page-size="PAGE_SIZE" 属性。 例如。

    <table class="table table-hover text-center" id="table" data-height="400" data-show-columns="true" data-toggle="table" data-search="true" data-show-export="true" data-pagination="true" data-click-to-select="true" data-toolbar="#toolbar" data-page-size="50" data-show-columns="true"> 
              <thead>
              </thead>
              <tbody>
              </tbody>
    </table>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-19
      • 2017-11-22
      • 2017-07-11
      • 2016-09-15
      • 2020-11-06
      相关资源
      最近更新 更多