How to change default value of page-size in bootstrap table?

user1298426 picture user1298426 · Jun 26, 2015 · Viewed 16k times · Source

I am using this bootstrap table http://wenzhixin.net.cn/p/bootstrap-table/docs/examples.html#client-side-pagination-table

which gives default page-size of 10. How can I change it to 5 or anything when the grid is loaded.

It gives option of selecting it data-page-list="[5,10]" but by default on load it keeps it 10.

Answer

Guruprasad J Rao picture Guruprasad J Rao · Jun 26, 2015

You can use page pageSize property of bootstrap table like

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

Read Docs