layui table 中有2个属性,分别是
1、limit默认页数,如图
2、limits 最大条数筛选项是数组 ,效果如图
代码如下
table.render({
elem: '#test'
,url:'/courseorder/listJson'
,toolbar: '#toolbarDemo'
,title: '用户数据表'
,totalRow: true
,cols: [
[
{type: 'checkbox', fixed: 'left'}
,{field:'id', title:'ID', width:80, fixed: 'left', unresize: true, sort: true, totalRowText: '合计'}
,{field:'name', title:'名字', width:120}
,{field:'wechat_mark', title:'微信备注', width:120}
,{field:'wechat_no', title:'微信id', width:120}
,{field:'qq_no', title:'QQ号', width:120}
,{field:'course_name', title:'购买课程', width:120}
,{field:'course_price', title:'价格', width:120}
,{field:'order_date', title:'订单日期', width:120}
,{fixed: 'right', title:'操作', toolbar: '#barDemo', width:150}
]
]
,page: true
// 默认页数
,limit:7
//最大条数筛选项
,limits:[7,8,9,10]
});