欢迎您访问我爱IT技术网,今天小编为你分享的javascript教程:【ExtJs中gridpanel分组后组名排序实例代码】,下面是详细的讲解!
ExtJs中gridpanel分组后组名排序实例代码
var DescGroupingStore=Ext.extend(Ext.data.GroupingStore, {
groupDir : 'ASC',
groupBy : function(field, forceRegroup, direction) {
direction=direction ? (String(direction)
.toUpperCase()=='DESC' ? 'DESC' : 'ASC')
: this.groupDir;
if (this.groupField==field
this.groupDir==direction && !forceRegroup) {
return;
}
this.groupField=field;
this.groupDir=direction;
if (this.remoteGroup) {
if (!this.baseParams) {
this.baseParams={};
}
this.baseParams['groupBy']=field;
this.baseParams['groupDir']=direction;
}
if (this.groupOnSort) {
this.sort(field, direction);
return;
}
if (this.remoteGroup) {
this.reload();
} else {
var si=this.sortInfo || {};
if (si.field !=field || si.direction !=direction) {
this.applySort();
} else {
this.sortData(field, direction);
}
this.fireEvent('datachanged', this);
}
},
applySort : function() {
Ext.data.GroupingStore.superclass.applySort.call(this);
if (!this.groupOnSort && !this.remoteGroup) {
if (this.groupField !=this.sortInfo.field
|| this.groupDir !=this.sortInfo.direction) {
this.sortData(this.groupField, this.groupDir);
}
}
},
applyGrouping : function(alwaysFireChange) {
if (this.groupField !==false) {
this.groupBy(this.groupField, true, this.groupDir);
return true;
} else {
if (alwaysFireChange===true) {
this.fireEvent('datachanged', this);
}
return false;
}
}
});
关于ExtJs中gridpanel分组后组名排序实例代码的用户互动如下:
相关问题:加分! Extjs5.0版本中Ext.grid.property.Grid组件...
答:你是想让那一列不允许排序么?列属性里有个sortable,新建的时候设为false 比如 Ext.create('Ext.data.Store', { storeId:'employeeStore', fields:['firstname', 'lastname', 'seniority', 'dep', 'hired'], data:[ {firstname:"Michael", last... >>详细
相关问题:EXT如何通过代码对GridPanel某一列进行排序,我想...
答:grid.store.sort('id','ASC');//或者DESC >>详细
相关问题:extjs gridpanel 为什么排序不可用
答:Column 中加上 sortable : true //是否可排序 >>详细
- 【firefox】firefox浏览器不支持innerText的解决
- 【Extjs】Extjs学习过程中新手容易碰到的低级错误
- 【clearInterval】js clearInterval()方法的定义
- 【ComboBox】ComboBox 和 DateField 在IE下消失的
- 【dom】javascript dom追加内容实现示例-追加内容
- 【has】基于jquery的has()方法以及与find()方法以
- 【extjs】Extjs入门之动态加载树代码-动态加载树
- 【checkbox】让checkbox不选中即将选中的checkbox
- 【Array】js中更短的 Array 类型转换-类型转换
- 【append】append和appendTo的区别以及appendChil
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
