關於layui 前台頁面表單顯示內容


function loadTickets(jsonEntity) {
        var id = $("#byId").val();
        table.render({
            elem : '#test',
            url : url,   //這里寫調用后台方法的路徑
            height: 450, //設置表單的長度,也可以設置寬度 width;
            toolbar : '#toolbarDemo', // 開啟工具欄,此處顯示默認圖標,可以自定義模板,詳見文檔
            page : true,    //page:為true 時, 開啟分頁功能,為false時,關閉分頁功能;
            unresize : false,    //是否禁用拖拽列寬;默認為false
            where : jsonEntity, 
            totalRow : true,// 開啟合計行
            limits : [ 5, 15, 30 ], //設置分頁的下拉條數;
            limit : 5,  //設置每頁顯示幾條
            async : false,
            cols : [ [ {
                type : 'checkbox', //加上復選框
                fixed : 'left' //放在左邊
            }, {
                field : 'name',title : '名稱',    event : 'monthSign',    width : '20%',    align : 'center',    edit : 'text',
                templet : function(row) {
                    return row.name;
                }
            }, {
                field : 'code',title : '編碼',    event : 'monthSign',    width : '7%',    align : 'center',    edit : 'text',
                templet : function(row) {
                    return row.code;
                }
            }, {
                field : 'path',title : '路徑',    event : 'monthSign',    width:'10%',    align : 'center',    edit : 'text',
                templet : function(row) {
                    return row.path;
                }
            } ] ],
            done : function(res, curr, count) {
                currentPage = curr;
            }
        });

    }

基本上一行一注釋了。。。

當然了,官方文檔更加清晰應該:    https://www.layui.com/demo/table/toolbar.html

 
         
         
        
 
       


免責聲明!

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



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