关键内容:
visible: false //这一列隐藏
<script th:inline="javascript">
var datas = [[${@dict.getType('sys_normal_disable')}]];
var prefix = ctx + "system/role/authUser";
$(function() {
var options = {
url: prefix + "/unallocatedList",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
importUrl: prefix + "/importData",
importTemplateUrl: prefix + "/importTemplate",
queryParams: queryParams,
sortName: "createTime",
sortOrder: "desc",
modalName: "用户",
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
clickToSelect: true,
rememberSelected: true,
method: 'get', //默认是post,不允许对静态文件访问
cache: false,
striped: true, // 隔行加亮
pagination: true, // 开启分页功能
pageSize: 20, // 设置默认分页为 20
pageNumber: 1,
pageList: [10, 25, 50, 100, 200], // 自定义分页列表
//contentType: "application/x-www-form-urlencoded",//如果想用request.form 方式,设置 contentType: "application/x-www-form-urlencoded",
search: false,//开启搜索功能
sidePagination: 'server',//设置为服务器端分页
queryParams: queryParams,//参数
showColumns: true, // 开启自定义列显示功能
showRefresh: false, // 开启刷新功能
minimumCountColumns: 2,// 设置最少显示列个数
clickToSelect: true,
smartDisplay: true,
clickToSelect: true, // 单击行即可以选中
sortName: 'OrderRealItemsId', // 设置默认排序为 name
sortOrder: 'desc', // 设置排序为反序 desc
smartDisplay: true, // 智能显示 pagination 和 cardview 等
dataType: "json",
columns: [{
checkbox: true
},
{
field: 'userId',
title: '编号',
visible: false //这一列隐藏
},
{
field: 'userName',
title: '姓名',
sortable: true
},
{
field: 'phonenumber',
title: '手机'
},
{
field: 'createTime',
title: '创建时间',
sortable: true
}]
};
$.table.init(options);
});