js實(shí)現(xiàn):
layui.use(['table','form'], function() {$ = layui.jquery;table = layui.table;tableIns = initTable();});//加載列表function initTable(){// 執(zhí)行渲染tableIns = table.render({id: 'idTest',elem : '#deviceTable', // 指定原始表格元素選擇器(推薦id選擇器)size: 'lg',height : 'full-20', // 容器高度url : '/csCloud-admin/deviceController/getDeviceList.do',where: {'orgId':$("#orgId").val(),'coldNum':$("#coldNum").val(),'devType':$("#devType").val(),'isUsed':$("#isUsedId").val()},method : 'post',cols : [ [ // 標(biāo)題欄{field : 'rownum',title : '序號',width : 100,sort : true}, {field : 'devNum',title : '設(shè)備編號',width : 200}, {field : 'devAlias',title : '設(shè)備別名',width : 100}, {field : 'devTypeVal',title : '設(shè)備類型',width : 100}, {field : 'devModel',title : '設(shè)備型號',width : 100}, {field : 'stateVal',title : '設(shè)備狀態(tài)',width : 100}, {field : 'coldNum',title : '冷庫編號',width : 100}, {field : 'orgName',title : '所屬機(jī)構(gòu)',width : 300}, {field : 'isUsedValue',title : '狀態(tài)',width : 100}, {fixed : 'right',width : 300,align:'center',toolbar : '#barDemo'}] ], // 設(shè)置表頭page : true,limits : [ 10,30, 60, 90, 150, 300 ],limit : 10});return tableIns;}jsp實(shí)現(xiàn):
<div class="layui-fluid"> <div class="layui-row"> <div class="layui-col-lg12"> <table id="deviceTable"></table> </div> </div> </div>
以上這篇layui實(shí)現(xiàn)table加載的示例代碼就是小編分享給大家的全部內(nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持錯(cuò)新站長站。
新聞熱點(diǎn)
疑難解答
圖片精選