首页 > 其他 > 详细

layui实现table加载的示例代码

时间:2020-03-31 10:36:40      阅读:74      评论:0      收藏:0      [点我收藏+]
 1 layui.use([table,form], function() {
 2 $ = layui.jquery;
 3 table = layui.table;
 4 tableIns = initTable();
 5 });
 6 //加载列表
 7 function initTable(){
 8 // 执行渲染
 9 tableIns = table.render({
10 id: idTest,
11 elem : #deviceTable, // 指定原始表格元素选择器(推荐id选择器)
12 size: lg,
13 height : full-20, // 容器高度
14 url : /csCloud-admin/deviceController/getDeviceList.do,
15 where: {
16 orgId:$("#orgId").val(),
17 coldNum:$("#coldNum").val(),
18 devType:$("#devType").val(),
19 isUsed:$("#isUsedId").val()
20 },
21 method : post,
22 cols : [ [ // 标题栏
23 {
24 field : rownum,
25 title : 序号,
26 width : 100,
27 sort : true
28 }, {
29 field : devNum,
30 title : 设备编号,
31 width : 200
32 }, {
33 field : devAlias,
34 title : 设备别名,
35 width : 100
36 }, {
37 field : devTypeVal,
38 title : 设备类型,
39 width : 100
40 }, {
41 field : devModel,
42 title : 设备型号,
43 width : 100
44 }, {
45 field : stateVal,
46 title : 设备状态,
47 width : 100
48 }, {
49 field : coldNum,
50 title : 冷库编号,
51 width : 100
52 }, {
53 field : orgName,
54 title : 所属机构,
55 width : 300
56 }, {
57 field : isUsedValue,
58 title : 状态,
59 width : 100
60 }, {
61 fixed : right,
62 width : 300,
63 align:center,
64 toolbar : #barDemo
65 }
66 ] ], // 设置表头
67 page : true,
68 limits : [ 10,30, 60, 90, 150, 300 ],
69 limit : 10
70 });
71 return tableIns;
72 }
1 <div class="layui-fluid">
2   <div class="layui-row">
3       <div class="layui-col-lg12">
4      <table id="deviceTable"></table>
5      </div>
6   </div>
7 </div>

 

layui实现table加载的示例代码

原文:https://www.cnblogs.com/lgx5/p/12602968.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!