layui数据表格的方法渲染
html代码
<table class="layui-table" id="test" lay-filter="test"></table>
js代码
<script type="text/javascript"> layui.use(['table'], function () { var $ = layui.jquery, table = layui.table, table.render({ elem: '#test' , url: '/Software/GetSoftware' , cellMinWidth: 110 , even: true , id: 'test' , page: true , toolbar: '#toolbarDemo' ,request: { pageName: 'page' , limitName: 'limit' } , cols: [[ { field: 'HotelName', title: '酒店名称', fixed: 'left', align: 'left', width:250, templet: '<div><span title="{{d.HotelName}}">{{d.HotelName}}</span></div>' } , { field: 'HotelId', title: '酒店ID', align: 'left' } , { field: 'Training', title: '负责人', align: 'left' } , { field: 'Docking', title: '对接人', align: 'left' } , { field: 'DeskPhone', title: '联系电话', align: 'left' } , { fixed: 'right', title: '操作', toolbar: '#barDemo', width:150, align: 'center' } ]] , response: { statusName: 'Context' , countName: 'count' , dataName: 'data' } , done: function (res, curr, count) { $("test").css("width", "100%", "height", "100%"); }; console.log("监听where:", this.where); tableFilterIns.reload(); }, }); }) </script>
标签:title,--,layui,align,渲染,field,table,left From: https://www.cnblogs.com/wxdream/p/16598096.html