1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <title>固定列 - 数据表格</title>
- <div class="layui-card layadmin-header">
- <div class="layui-breadcrumb" lay-filter="breadcrumb">
- <a lay-href="">主页</a>
- <a><cite>组件</cite></a>
- <a><cite>数据表格</cite></a>
- <a><cite>固定列</cite></a>
- </div>
- </div>
-
- <div class="layui-fluid">
- <div class="layui-row layui-col-space15">
- <div class="layui-col-md12">
- <div class="layui-card">
- <div class="layui-card-header">固定列</div>
- <div class="layui-card-body">
- <table class="layui-hide" id="test-table-fixed"></table>
- </div>
- </div>
- </div>
- </div>
- </div>
-
- <script>
- layui.use(['admin', 'table'], function(){
- var table = layui.table
- ,admin = layui.admin;
-
- table.render({
- elem: '#test-table-fixed'
- ,url: './json/table/user.js'
- ,width: admin.screen() > 1 ? 892 : ''
- ,height: 332
- ,cols: [[
- {type:'checkbox', fixed: 'left'}
- ,{field:'id', width:80, title: 'ID', sort: true, fixed: 'left'}
- ,{field:'username', width:80, title: '用户名'}
- ,{field:'sex', width:80, title: '性别', sort: true}
- ,{field:'city', width:80, title: '城市'}
- ,{field:'sign', width: 219, title: '签名'}
- ,{field:'experience', width:80, title: '积分', sort: true}
- ,{field:'score', width:80, title: '评分', sort: true}
- ,{field:'classify', width:80, title: '职业'}
- ,{field:'wealth', width:120, title: '财富', sort: true, fixed: 'right'}
- ]]
- ,page: true
- });
-
- });
- </script>
|