layui數據表格自定義每頁條數limit


table.render({
            elem: '#data_grid'
            //,width: 900
            //,height: 274
            ,cols: [[ //標題欄
                {field: 'id', title: 'ID', width: 80, sort: true}
                ,{field: 'username', title:'用戶名',width: 100} //空列
                ,{field: 'password', title: '密碼', width: 120}
                ,{field: 'gender', title: '性別', width: 150}
                ,{field: 'nichen', title: '昵稱', width: 150}
                ,{field: 'birthday', title: '出生年月', width: 120}
                ,{fixed: 'right', width: 215,align:'center', toolbar: '#barDemo'}
            ]]
            ,url:url
            ,skin: 'row' //表格風格
            ,even: true
            ,page: true //是否顯示分頁
            ,limits: [3,5,10]
            ,limit: 5 //每頁默認顯示的數量
            ,done:function(res){
                userPage.data = res.data;
            }
            //,loading: false //請求數據時,是否顯示loading
        }); 

 

主要是:limits 和 limit 的設置 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM