checkbox.html 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <title>开启复选框 - 数据表格</title>
  2. <div class="layui-card layadmin-header">
  3. <div class="layui-breadcrumb" lay-filter="breadcrumb">
  4. <a lay-href="">主页</a>
  5. <a><cite>组件</cite></a>
  6. <a><cite>数据表格</cite></a>
  7. <a><cite>开启复选框</cite></a>
  8. </div>
  9. </div>
  10. <div class="layui-fluid">
  11. <div class="layui-row layui-col-space15">
  12. <div class="layui-col-md12">
  13. <div class="layui-card">
  14. <div class="layui-card-header">开启复选框</div>
  15. <div class="layui-card-body">
  16. <table class="layui-hide" id="test-table-checkbox"></table>
  17. </div>
  18. </div>
  19. </div>
  20. </div>
  21. </div>
  22. <script>
  23. layui.use(['admin', 'table'], function(){
  24. var table = layui.table;
  25. table.render({
  26. elem: '#test-table-checkbox'
  27. ,url: './json/table/user.js'
  28. ,cols: [[
  29. {type:'checkbox'}
  30. ,{field:'id', width:80, title: 'ID', sort: true}
  31. ,{field:'username', width:80, title: '用户名'}
  32. ,{field:'sex', width:80, title: '性别', sort: true}
  33. ,{field:'city', width:80, title: '城市'}
  34. ,{field:'sign', title: '签名', minWidth: 100}
  35. ,{field:'experience', width:80, title: '积分', sort: true}
  36. ,{field:'score', width:80, title: '评分', sort: true}
  37. ,{field:'classify', width:80, title: '职业'}
  38. ,{field:'wealth', width:135, title: '财富', sort: true}
  39. ]]
  40. ,page: true
  41. });
  42. });
  43. </script>