复制番号代番号次のように:
/**
* 降順のグループ化ストアを決定
*/
var DescGroupingStore = Ext.extend(Ext.data.GroupingStore, {
グループディレクトリ: 'ASC'、
groupBy : function(フィールド、forceRegroup、方向) {
方向 = 方向 ? (文字列(方向)
.toUpperCase() == 'DESC' ? 'DESC' : 'ASC')
: this.groupDir;
if (this.groupField == フィールド
this.groupDir == 方向 && !forceRegroup) {
戻る;
}
this.groupField = フィールド;
this.groupDir = 方向;
if (this.remoteGroup) {
if (!this.baseParams) {
this.baseParams = {};
}
this.baseParams['groupBy'] = フィールド;
this.baseParams['groupDir'] = 方向;
}
if (this.groupOnSort) {
this.sort(フィールド、方向);
戻る;
}
if (this.remoteGroup) {
this.reload();
} それ以外 {
var si = this.sortInfo || {};
if (si.field != フィールド || si.direction != 方向) {
this.applySort();
} それ以外 {
this.sortData(フィールド、方向);
}
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);
true を返します。
} それ以外 {
if (alwaysFireChange === true) {
this.fireEvent('datachanged', this);
}
false を返します。
}
}
});
复制番号代番号次のように:
/*************************调用*********************** ****/
// メッセージ列表データソース
var messageStore = new DescGroupingStore({
プロキシ : new Ext.data.HttpProxy({
URL : "listMessGrid.action"
})、
リーダー: myReader、
グループディレクトリ: 'DESC',
グループフィールド: 'ステータス',
並べ替え情報: {
フィールド: 'id'、
方向:「DESC」
}
});
messageStore.load();
复制番号代番号次のように:
/*****************グリッドパネル内追加如下プロパティ************************** ***********/
ビュー: new Ext.grid.GroupingView({
showGroupName : false、
groupTextTpl : '{gvalue}:{text} ({[values.rs.length]} {[values.rs.length > 1 ? "封" : "封"]})',
showGroupsText : "ddd"
})