ExtJs中gridpanel分組后組名排序實例代碼
更新時間:2013年12月02日 14:57:38 作者:
這篇文章主要介紹了ExtJs中gridpanel分組后組名排序實例代碼,有需要的朋友可以參考一下
復制代碼 代碼如下:
/**
* 定義降序的groupingStore
*/
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;
}
}
});
復制代碼 代碼如下:
/*************************調用***************************/
// 消息列表數(shù)據(jù)源
var messageStore = new DescGroupingStore({
proxy : new Ext.data.HttpProxy({
url : "listMessGrid.action"
}),
reader : myReader,
groupDir : 'DESC',
groupField : 'status',
sortInfo : {
field : 'id',
direction : "DESC"
}
});
messageStore.load();
復制代碼 代碼如下:
/*****************在gridpanel中添加如下屬性*************************************/
view : new Ext.grid.GroupingView({
showGroupName : false,
groupTextTpl : '{gvalue}:{text} ({[values.rs.length]} {[values.rs.length > 1 ? "封" : "封"]})',
showGroupsText : "ddd"
})
您可能感興趣的文章:
- Extjs4實現(xiàn)兩個GridPanel之間數(shù)據(jù)拖拽功能具體方法
- ExtJs設置GridPanel表格文本垂直居中示例
- Extjs4 GridPanel 的幾種樣式使用介紹
- Extjs4 GridPanel的主要配置參數(shù)詳細介紹
- Extjs中的GridPanel隱藏列會顯示在menuDisabled中解決方法
- Extjs EditorGridPanel中ComboBox列的顯示問題
- Extjs gridpanel 出現(xiàn)橫向滾動條問題的解決方法
- ExtJs GridPanel簡單的增刪改實現(xiàn)代碼
- ExtJS 2.0 GridPanel基本表格簡明教程
- ExtJS GridPanel 根據(jù)條件改變字體顏色
- JavaScript的Ext JS框架中的GridPanel組件使用指南
相關文章
詳解webpack與SPA實踐之開發(fā)環(huán)境搭建
這篇文章主要介紹了詳解webpack與SPA實踐之開發(fā)環(huán)境搭建,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2017-12-12JavaScript中將number轉為string的5種方法
這篇文章主要給大家介紹了關于JavaScript中將number轉為string的5種方法,在JavaScript的值類型轉換中,最常發(fā)生的就是string與number這兩種類型值之間的相互轉換,需要的朋友可以參考下2023-07-07在iframe中使bootstrap的模態(tài)框在父頁面彈出問題
這篇文章主要介紹了在iframe中使bootstrap的模態(tài)框在父頁面彈出問題,解決方法非常不錯,具有參考借鑒價值,需要的朋友可以參考下2017-08-08