table.render({
id:'userId',//可以在这里设置需要隐藏的列的字段名,如果是要隐藏多列的话这样写 id:'id,sex'
elem: '#user',
width: '100%',
method: 'post',
page: true, //开启分页
url: serverUrl + "/user/selectall",
//contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
cols: [
[ //标题栏
{
field: 'number',
title: '序号',
width: 80,
type: 'numbers'
},
{
field: 'userName',
title: '用户姓名',
width: 260,
},
{
field: 'deptName',
title: '所属部门',
minWidth: 100,
},
{
field: 'userCode',
title: '用户账号',
minWidth: 150,
},
{
field: 'isUsed',
title: '是否启用',
minWidth: 150,
},
{
field: '',
title: '',
width: 500,
},
{
field: 'btn',
title: '操作',
width: 300,
align: 'center',
fixed: 'right',
toolbar: '#useroperation',
}
]
],
data: [{
"username": "张三",
"dept": "运营管理部",
"usercode": "1234567789",
"isStart": "是",
}],
//,skin: 'line' //表格风格
even: true,
page: true, //是否显示分页
skip: true, //开启跳页
limits: [10, 20, 30],
limit: 10, //每页默认显示的数量
request: {
pageName: 'pageNum', //页码的参数名称,默认:page
limitName: 'pageSize' //每页数据量的参数名,默认:limit
}
});