<table class="layui-table" lay-data="{width: 892, height:332, url:'/demo/table/user/', page:true, id:'idTest'}" lay-filter="demo"> <thead> <tr> <th lay-data="{type:'checkbox', fixed: 'left'}"></th> <th lay-data="{field:'id', width:80, sort: true, fixed: true}">ID</th> <th lay-data="{field:'username', width:80}">用户名</th> <th lay-data="{field:'sex', width:80, sort: true}">性别</th> <th lay-data="{field:'city', width:80}">城市</th> <th lay-data="{field:'sign', width:160}">签名</th> <th lay-data="{field:'experience', width:80, sort: true}">积分</th> <th lay-data="{field:'classify', width:80}">职业</th> <th lay-data="{field:'wealth', width:135, sort: true}">财富</th> <th lay-data="{field:'score', width:80, sort: true, fixed: 'right'}">评分</th> <th lay-data="{fixed: 'right', width:178, align:'center', toolbar: '#barDemo'}"></th> </tr> </thead></table>
<script>layui.use('table', function(){ var table = layui.table; var $ = layui.$, active = { getCheckData: function(){ //获取选中数据 var checkStatus = table.checkStatus('idTest') ,data = checkStatus.data; layer.alert(JSON.stringify(data)); } };</script>