X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6e39d509471fe9b4e2660e0d1631b350d0c66f40..2e847cf21b8ab9d15fa167b315ca5b2fa92638fc:/docs/source/GroupingStore.html diff --git a/docs/source/GroupingStore.html b/docs/source/GroupingStore.html index b85a0193..1162162d 100644 --- a/docs/source/GroupingStore.html +++ b/docs/source/GroupingStore.html @@ -19,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 ''). @@ -44,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(); @@ -73,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); @@ -88,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); @@ -96,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 + }); + } } },