X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775..2e847cf21b8ab9d15fa167b315ca5b2fa92638fc:/docs/source/GroupingStore.html diff --git a/docs/source/GroupingStore.html b/docs/source/GroupingStore.html index aa0f925b..1162162d 100644 --- a/docs/source/GroupingStore.html +++ b/docs/source/GroupingStore.html @@ -1,17 +1,12 @@ - - - The source code - - - - -
/*!
- * Ext JS Library 3.0.3
- * Copyright(c) 2006-2009 Ext JS, LLC
- * licensing@extjs.com
- * http://www.extjs.com/license
- */
-
/** + + + + The source code + + + + +
/** * @class Ext.data.GroupingStore * @extends Ext.data.Store * A specialized store implementation that provides for grouping records by one of the available fields. This @@ -24,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 ''). @@ -49,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(); @@ -78,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); @@ -93,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); @@ -101,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 + }); + } } }, @@ -143,6 +152,6 @@ Ext.data.GroupingStore = Ext.extend(Ext.data.Store, { (this.sortInfo ? this.sortInfo.field : undefined) : this.groupField; } }); -Ext.reg('groupingstore', Ext.data.GroupingStore);
- +Ext.reg('groupingstore', Ext.data.GroupingStore);
+ \ No newline at end of file