X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..92c2b89db26be16707f4a805d3303ab2531006e1:/docs/source/GroupingStore.html?ds=inline
diff --git a/docs/source/GroupingStore.html b/docs/source/GroupingStore.html
index 98fc34fd..1162162d 100644
--- a/docs/source/GroupingStore.html
+++ b/docs/source/GroupingStore.html
@@ -1,5 +1,6 @@
+
The source code
@@ -18,13 +19,13 @@
* @xtype groupingstore
*/
Ext.data.GroupingStore = Ext.extend(Ext.data.Store, {
-
+
//inherit docs
constructor: function(config){
Ext.data.GroupingStore.superclass.constructor.call(this, config);
this.applyGroupField();
},
-
+
/**
* @cfg {String} groupField
* The field name by which to sort the store's data (defaults to '').
@@ -43,21 +44,25 @@ Ext.data.GroupingStore = Ext.extend(Ext.data.Store, {
*/
groupOnSort:false,
- groupDir : 'ASC',
-
+ groupDir : 'ASC',
+
/**
* Clears any existing grouping and refreshes the data using the default sort.
*/
clearGrouping : function(){
this.groupField = false;
+
if(this.remoteGroup){
if(this.baseParams){
delete this.baseParams.groupBy;
+ delete this.baseParams.groupDir;
}
var lo = this.lastOptions;
if(lo && lo.params){
delete lo.params.groupBy;
+ delete lo.params.groupDir;
}
+
this.reload();
}else{
this.applySort();
@@ -72,12 +77,12 @@ Ext.data.GroupingStore = Ext.extend(Ext.data.Store, {
* in is the same as the current grouping field, false to skip grouping on the same field (defaults to false)
*/
groupBy : function(field, forceRegroup, direction){
- direction = direction ? (String(direction).toUpperCase() == 'DESC' ? 'DESC' : 'ASC') : this.groupDir;
+ direction = direction ? (String(direction).toUpperCase() == 'DESC' ? 'DESC' : 'ASC') : this.groupDir;
if(this.groupField == field && this.groupDir == direction && !forceRegroup){
return; // already grouped by this field
}
this.groupField = field;
- this.groupDir = direction;
+ this.groupDir = direction;
this.applyGroupField();
if(this.groupOnSort){
this.sort(field, direction);
@@ -87,7 +92,7 @@ Ext.data.GroupingStore = Ext.extend(Ext.data.Store, {
this.reload();
}else{
var si = this.sortInfo || {};
- if(si.field != field || si.direction != direction){
+ if(forceRegroup || si.field != field || si.direction != direction){
this.applySort();
}else{
this.sortData(field, direction);
@@ -95,15 +100,25 @@ Ext.data.GroupingStore = Ext.extend(Ext.data.Store, {
this.fireEvent('datachanged', this);
}
},
-
+
// private
applyGroupField: function(){
if(this.remoteGroup){
if(!this.baseParams){
this.baseParams = {};
}
- this.baseParams.groupBy = this.groupField;
- this.baseParams.groupDir = this.groupDir;
+ Ext.apply(this.baseParams, {
+ groupBy : this.groupField,
+ groupDir : this.groupDir
+ });
+
+ var lo = this.lastOptions;
+ if(lo && lo.params){
+ Ext.apply(lo.params, {
+ groupBy : this.groupField,
+ groupDir : this.groupDir
+ });
+ }
}
},