自動渲染如何獲取到 done: function 回傳函式
<table class="layui-table" lay-data="https://bbs.csdn.net/topics/{height: 'full-200', cellMinWidth: 80, page: true, limit:30, url:'/demo/table/user/'}">
<thead>
<tr>
<th lay-data="https://bbs.csdn.net/topics/{type:'checkbox'}">ID</th>
<th lay-data="https://bbs.csdn.net/topics/{field:'id', width:100, sort: true}">ID</th>
<th lay-data="https://bbs.csdn.net/topics/{field:'username', width:100}">用戶名</th>
<th lay-data="https://bbs.csdn.net/topics/{field:'sex', width:100, sort: true}">性別</th>
</tr>
</thead>
</table>
<script src="https://bbs.csdn.net//res.layui.com/layui/dist/layui.js" charset="utf-8"></script>
<script>
layui.use('table', function(){
var table = layui.table;
table.render({
done: function(res, curr, count){
console.log(res);
}
});
});
</script>
uj5u.com熱心網友回復:
自動渲染和方法渲染不能混用吧好像<table class="layui-table" lay-data="https://bbs.csdn.net/topics/{height: 'full-200', cellMinWidth: 80, page: true, limit:30, url:'/demo/table/user/',done:function(res){layer.msg(res);}}">
<thead>
<tr>
<th lay-data="https://bbs.csdn.net/topics/{type:'checkbox'}">ID</th>
<th lay-data="https://bbs.csdn.net/topics/{field:'id', width:100, sort: true}">ID</th>
<th lay-data="https://bbs.csdn.net/topics/{field:'username', width:100}">用戶名</th>
<th lay-data="https://bbs.csdn.net/topics/{field:'sex', width:100, sort: true}">性別</th>
</tr>
</thead>
</table>
uj5u.com熱心網友回復:
table.render({elem: '#test',
type: "get",
url:
, cellMinWidth: 80 //全域定義常規單元格的最小寬度,layui 2.2.1 新增
, headers: { "token": koo }
, page: true
, cols: [[
,{ fixed: 'right', align: 'center',width:300, toolbar: '#barDemo', title: 'id' }
]]
});
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/30411.html
標籤:JavaScript
上一篇:求求大神救命
