fixed.html 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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-fixed"></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. ,admin = layui.admin;
  26. table.render({
  27. elem: '#test-table-fixed'
  28. ,url: './json/table/user.js'
  29. ,width: admin.screen() > 1 ? 892 : ''
  30. ,height: 332
  31. ,cols: [[
  32. {type:'checkbox', fixed: 'left'}
  33. ,{field:'id', width:80, title: 'ID', sort: true, fixed: 'left'}
  34. ,{field:'username', width:80, title: '用户名'}
  35. ,{field:'sex', width:80, title: '性别', sort: true}
  36. ,{field:'city', width:80, title: '城市'}
  37. ,{field:'sign', width: 219, title: '签名'}
  38. ,{field:'experience', width:80, title: '积分', sort: true}
  39. ,{field:'score', width:80, title: '评分', sort: true}
  40. ,{field:'classify', width:80, title: '职业'}
  41. ,{field:'wealth', width:120, title: '财富', sort: true, fixed: 'right'}
  42. ]]
  43. ,page: true
  44. });
  45. });
  46. </script>