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列的顯示問題
- Extjs gridpanel 出現(xiàn)橫向滾動(dòng)條問題的解決方法
- ExtJs GridPanel簡(jiǎn)單的增刪改實(shí)現(xiàn)代碼
- ExtJS 2.0 GridPanel基本表格簡(jiǎn)明教程
- ExtJS GridPanel 根據(jù)條件改變字體顏色
- JavaScript的Ext JS框架中的GridPanel組件使用指南
相關(guān)文章
詳解webpack與SPA實(shí)踐之開發(fā)環(huán)境搭建
這篇文章主要介紹了詳解webpack與SPA實(shí)踐之開發(fā)環(huán)境搭建,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2017-12-12JavaScript中將number轉(zhuǎn)為string的5種方法
這篇文章主要給大家介紹了關(guān)于JavaScript中將number轉(zhuǎn)為string的5種方法,在JavaScript的值類型轉(zhuǎn)換中,最常發(fā)生的就是string與number這兩種類型值之間的相互轉(zhuǎn)換,需要的朋友可以參考下2023-07-07JS利用正則表達(dá)式實(shí)現(xiàn)簡(jiǎn)單的密碼強(qiáng)弱判斷實(shí)例
這篇文章主要給大家介紹了關(guān)于JS利用正則表達(dá)式實(shí)現(xiàn)簡(jiǎn)單的密碼強(qiáng)弱判斷的相關(guān)資料,實(shí)現(xiàn)后的效果非常簡(jiǎn)單,但也挺實(shí)用的,文中給出了詳細(xì)的示例代碼供大家參考學(xué)習(xí),需要的朋友們下面來一起看看吧。2017-06-06在iframe中使bootstrap的模態(tài)框在父頁(yè)面彈出問題
這篇文章主要介紹了在iframe中使bootstrap的模態(tài)框在父頁(yè)面彈出問題,解決方法非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下2017-08-08javascript 強(qiáng)制刷新頁(yè)面的實(shí)現(xiàn)代碼
javascript 強(qiáng)制刷新頁(yè)面的代碼,大家經(jīng)常能用的到。2009-12-12關(guān)于Javascript中值得學(xué)習(xí)的特性總結(jié)
本文主要介紹了一些Javascript中值得學(xué)習(xí)的特性,可選鏈操作符,空值合并運(yùn)算符,Promise.allSettled(),BigInt類型等特性,文中有詳細(xì)的代碼示例介紹這些特性,感興趣的可以參考下2023-05-05