layui的table.render使用


 var tableIns = table.render({
        elem: '#recordList',  // 指向頁面組件id
        where: { UId: 1 },  // 傳遞參數
        url: '/Manager/GetList/',  // 異步獲取數據
        cellMinWidth: 95,
        page: true,  // 開啟分頁
        height: "full-125",
        limits: [10, 15, 20, 25],
        limit: 10,   // 每頁條數
        id: "recordListTable",  // 本表id
        cols: [[
            { type: "checkbox", fixed: "left", width: 50 },
            { field: "ID", title: 'ID', width: 120, minWidth: 90, align: "center" },
            { field: 'Time', title: '日期', minWidth: 180, align: "center" },
            { field: 'Name', title: '名字', minWidth: 180, align: "center" },
            { field: 'Content', title: '內容', minWidth: 400, align: 'center' },
            { field: 'IsLock', title: '是否鎖定', minWidth: 100, fixed: "right", align: "center", templet: '#IsLock' },
            { title: '操作', minWidth: 150, templet: '#recordListBar', fixed: "right", align: "center" }
        ]],
done: function () { $("[data-field='ID']").css('display','none'); } // 列隱藏 });

 


免責聲明!

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



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