ExtJs中g(shù)ridpanel分組后組名排序?qū)嵗a
更新時(shí)間:2013年12月02日 14:57:38 作者:
這篇文章主要介紹了ExtJs中g(shù)ridpanel分組后組名排序?qū)嵗a,有需要的朋友可以參考一下

復(fù)制代碼 代碼如下:
/**
* 定義降序的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;
}
}
});
復(fù)制代碼 代碼如下:
/*************************調(diào)用***************************/
// 消息列表數(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();
復(fù)制代碼 代碼如下:
/*****************在gridpanel中添加如下屬性*************************************/
view : new Ext.grid.GroupingView({
showGroupName : false,
groupTextTpl : '{gvalue}:{text} ({[values.rs.length]} {[values.rs.length > 1 ? "封" : "封"]})',
showGroupsText : "ddd"
})
您可能感興趣的文章:
- Extjs4實(shí)現(xiàn)兩個(gè)GridPanel之間數(shù)據(jù)拖拽功能具體方法
- ExtJs設(shè)置GridPanel表格文本垂直居中示例
- Extjs4 GridPanel 的幾種樣式使用介紹
- Extjs4 GridPanel的主要配置參數(shù)詳細(xì)介紹
- Extjs中的GridPanel隱藏列會(huì)顯示在menuDisabled中解決方法
- Extjs EditorGridPanel中ComboBox列的顯示問(wèn)題
- Extjs gridpanel 出現(xiàn)橫向滾動(dòng)條問(wèn)題的解決方法
- ExtJs GridPanel簡(jiǎn)單的增刪改實(shí)現(xiàn)代碼
- ExtJS 2.0 GridPanel基本表格簡(jiǎn)明教程
- ExtJS GridPanel 根據(jù)條件改變字體顏色
- JavaScript的Ext JS框架中的GridPanel組件使用指南
相關(guān)文章
JavaScript裝飾器的實(shí)現(xiàn)原理詳解
最近在使用TS+Vue的開發(fā)模式,發(fā)現(xiàn)項(xiàng)目中大量使用了裝飾器,看得我手足無(wú)措,今天特意研究一下實(shí)現(xiàn)原理,方便自己理解這塊知識(shí)點(diǎn),有需要的小伙伴也可以參考一下2022-10-10
通過(guò)Tabs方法基于easyUI+bootstrap制作工作站
本教程給大家介紹如何制作easyUI+bootstrap工作站,主要學(xué)習(xí)tabs方法,本文介紹非常詳細(xì),具有參考借鑒價(jià)值,需要的朋友參考下吧2016-03-03
bootstrap-table實(shí)現(xiàn)服務(wù)器分頁(yè)的示例 (spring 后臺(tái))
本篇文章主要介紹了bootstrap-table實(shí)現(xiàn)服務(wù)器分頁(yè)的示例 (spring 后臺(tái)),具有一定的參考價(jià)值,有興趣的可以了解一下2017-09-09
javascript實(shí)現(xiàn)的顏色塊滑動(dòng)的動(dòng)態(tài)效果
javascript實(shí)現(xiàn)的顏色塊滑動(dòng)的動(dòng)態(tài)效果...2007-08-08
js實(shí)現(xiàn)控制textarea輸入字符串的個(gè)數(shù),鼠標(biāo)按下抬起判斷輸入字符數(shù)
下面小編就為大家?guī)?lái)一篇js實(shí)現(xiàn)控制textarea輸入字符串的個(gè)數(shù),鼠標(biāo)按下抬起判斷輸入字符數(shù)。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2016-10-10
微信小程序?qū)崿F(xiàn)動(dòng)態(tài)驗(yàn)證碼
這篇文章主要為大家詳細(xì)介紹了微信小程序?qū)崿F(xiàn)動(dòng)態(tài)驗(yàn)證碼,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2022-05-05
解決layui-open關(guān)閉自身窗口的問(wèn)題
今天小編就為大家分享一篇解決layui-open關(guān)閉自身窗口的問(wèn)題,具有好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2019-09-09
基于bootstrap實(shí)現(xiàn)收縮導(dǎo)航條
這篇文章主要介紹了基于bootstrap實(shí)現(xiàn)收縮導(dǎo)航條的相關(guān)資料,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-03-03

