多列排序演示,指定点击标题可设定初次排序方式。

This commit is contained in:
thinkgem
2019-08-23 22:52:05 +08:00
parent aeca519c8c
commit 067134b942
2 changed files with 5 additions and 4 deletions

View File

@@ -178,7 +178,6 @@ $('#dataGrid').dataGrid({
frozenCols: true, // 启用冻结列并在colModel中设置frozen:true
showRownum: true, // 是否显示行号默认true
showFooter: true, // 是否显示底部合计行,数据载入详见 ajaxSuccess
multiSort: true, // 是否支持多列排序
// ================ 设置多级表头 BEGIN ==============
// 设置多级表头

View File

@@ -149,7 +149,7 @@ $('#dataGrid').dataGrid({
{header:'${text("状态")}', name:'status', index:'a.status', width:150, align:"center", formatter: function(val, obj, row, act){
return js.getDictLabel(${@DictUtils.getDictListJson('sys_search_status')}, val, '${text("未知")}', true);
}},
{header:'${text("创建时间")}', name:'createDate', index:'a.create_date', width:150, align:"center"},
{header:'${text("创建时间")}', name:'createDate', index:'a.create_date', firstsortorder:'desc', width:150, align:"center"},
{header:'${text("备注信息")}', name:'remarks', index:'a.remarks', width:150, align:"left"},
{header:'${text("操作")}', name:'actions', width:200, sortable:false, title:false, formatter: function(val, obj, row, act){
var actions = [];
@@ -198,8 +198,8 @@ $('#dataGrid').dataGrid({
return js.getDictLabel(${@DictUtils.getDictListJson('sys_menu_type')}, val, '${text("未知")}', true);
}},
{header:'${text("日期时间")}', name:'testDatetime', width:150, align:"center"},
{header:'${text("用户名称")}', name:'testUser.userName', width:150, align:"center"},
{header:'${text("机构名称")}', name:'testOffice.officeName', width:150, align:"center"},
{header:'${text("用户名称")}', name:'testUser.userName', sortable:false, width:150, align:"center"},
{header:'${text("机构名称")}', name:'testOffice.officeName', sortable:false, width:150, align:"center"},
{header:'${text("区域名称")}', name:'testAreaName', width:150, align:"center"}
],
// 加载成功后执行事件
@@ -208,6 +208,8 @@ $('#dataGrid').dataGrid({
}
});
},
multiSort: true, // 是否支持多列排序,给列指定 firstsortorder 可设定初次排序方式
// 加载成功后执行事件
ajaxSuccess: function(data){