| autoDestroy : Booleantrue to destroy the store when the component the store is bound
+ A specialized store implementation that provides for grouping records by one of the available fields. This
+is usually used in conjunction with an Ext.grid.GroupingView to provide the data model for
+a grouped GridPanel.
+Internally, GroupingStore is simply a normal Store with multi sorting enabled from the start. The grouping field
+and direction are always injected as the first sorter pair. GroupingView picks up on the configured groupField and
+builds grid rows appropriately. Config Options|
| autoDestroy : Booleantrue to destroy the store when the component the store is bound
to is destroyed (defaults to false).
Note: this shoul... true to destroy the store when the component the store is bound
to is destroyed (defaults to false).
@@ -31,8 +34,8 @@ to false.
generated for each record. | Store | | data : ArrayAn inline data object readable by the reader .
Typically this option, or the url option will be specified. | Store | | defaultParamNames : ObjectProvides the default values for the paramNames property. To globally modify the parameters
for all stores, this objec... Provides the default values for the paramNames property. To globally modify the parameters
-for all stores, this object should be changed on the store prototype. | Store | | groupField : String The field name by which to sort the store's data (defaults to ''). | GroupingStore | | groupOnSort : BooleanTrue to sort the data on the grouping field when a grouping operation occurs, false to sort based on the
-existing so... True to sort the data on the grouping field when a grouping operation occurs, false to sort based on the
+for all stores, this object should be changed on the store prototype. | Store | | groupField : String The field name by which to sort the store's data (defaults to ''). | GroupingStore | | groupOnSort : BooleanTrue to sort the data on the grouping field when a grouping operation occurs, false to sort based on the
+existing sor... True to sort the data on the grouping field when a grouping operation occurs, false to sort based on the
existing sort info (defaults to false). | GroupingStore | | listeners : ObjectA config object containing one or more event handlers to be added to this
object during initialization. This should ... A config object containing one or more event handlers to be added to this
object during initialization. This should be a valid listeners config object as specified in the
@@ -108,9 +111,9 @@ the store is loaded or when a record is removed (defaults to false). Se
for the accessor method to retrieve the modified records. | Store | | reader : Ext.data.DataReaderThe Reader object which processes the
data object and returns an Array of Ext.data.Record objects which are cached ke... The Reader object which processes the
data object and returns an Array of Ext.data.Record objects which are cached keyed by their
- id property. | Store | | remoteGroup : BooleanTrue if the grouping should apply on the server side, false if it is local only (defaults to false). If the
-groupin... True if the grouping should apply on the server side, false if it is local only (defaults to false). If the
-grouping is local, it can be applied immediately to the data. If it is remote, then it will simply act as a
+ id property. | Store | | remoteGroup : BooleanTrue if the grouping should apply on the server side, false if it is local only (defaults to false). If the
+grouping... True if the grouping should apply on the server side, false if it is local only (defaults to false). If the
+grouping is local, it can be applied immediately to the data. If it is remote, then it will simply act as a
helper, automatically sending the grouping field name as the 'groupBy' param with each XHR call. | GroupingStore | | remoteSort : booleantrue if sorting is to be handled by requesting the Proxy
to provide a refreshed version of the data object in sorted ... true if sorting is to be handled by requesting the Proxy
to provide a refreshed version of the data object in sorted order, as opposed to sorting the Record cache
@@ -171,10 +174,13 @@ for a description of this property.
To modify this property see setBasePar... | Store | | fields : Ext.util.MixedCollection | Store | | lastOptions : ObjectContains the last options object used as the parameter to the load method. See load
+for the Records stored in this Store. Read-only. | Store | | hasMultiSort : Boolean
+True if this store is currently sorted by more than one field/direction combination. | Store | | isDestroyed : Boolean
+True if the store has been destroyed already. Read only | Store | | lastOptions : ObjectContains the last options object used as the parameter to the load method. See load
for the details of what this may ... Contains the last options object used as the parameter to the load method. See load
for the details of what this may contain. This may be useful for accessing any params which were used
-to load the current Record cache. | Store | | recordType : FunctionThe Record constructor as supplied to (or created by) the
+to load the current Record cache. | Store | | multiSortInfo : Object
+Object containing overall sort direction and an ordered array of sorter configs used when sorting on multiple fields | Store | | recordType : FunctionThe Record constructor as supplied to (or created by) the
Reader. Read-only.
If the Reader was constructed by passing... The Record constructor as supplied to (or created by) the
Reader. Read-only.
@@ -234,7 +240,7 @@ instead of a Record constructor, it will implicitly create a Record constructor
}
}]
}); | Store |
Public Methods|
| GroupingStore( Object config )
- Creates a new GroupingStore. Creates a new GroupingStore. Parameters:config : ObjectA config object containing the objects needed for the Store to access data,
+ Creates a new GroupingStore. Creates a new GroupingStore.
| GroupingStore | | add( Ext.data.Record[] records )
:
voidAdd Records to the Store and fires the add event. To add Records
@@ -320,42 +326,62 @@ Ext.data.Record.COMMIT. Parameters:<
Returning false aborts and exits the iteration. scope : Object(optional) The scope ( this reference) in which the function is executed.
Defaults to the current Record in the iteration. Returns: | Store | | enableBubble( String/Array events )
:
- voidEnables events fired by this Observable to bubble up an owner hierarchy by calling
-this.getBubbleTarget() if present... Enables events fired by this Observable to bubble up an owner hierarchy by calling
-this.getBubbleTarget() if present. There is no implementation in the Observable base class.
- This is commonly used by Ext.Components to bubble events to owner Containers. See Ext.Component.getBubbleTarget. The default
-implementation in Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to
-access the required target more quickly.
- Example: Ext.override(Ext.form.Field, {
- // Add functionality to Field's initComponent to enable the change event to bubble
- initComponent : Ext.form.Field.prototype.initComponent.createSequence(function() {
- this.enableBubble('change');
- }),
-
- // We know that we want Field's events to bubble directly to the FormPanel.
- getBubbleTarget : function() {
- if (!this.formPanel) {
- this.formPanel = this.findParentByType('form');
- }
- return this.formPanel;
- }
-});
-
-var myForm = new Ext.formPanel({
- title: 'User Details',
- items: [{
- ...
- }],
- listeners: {
- change: function() {
- // Title goes red if form has been modified.
- myForm.header.setStyle('color', 'red');
- }
- }
-});
| Observable | | filter( String field , String/RegExp value , [Boolean anyMatch ], [Boolean caseSensitive ] )
- :
- voidFilter the records by a specified property. Filter the records by a specified property. Parameters:field : StringA field on your records value : String/RegExpEither a string that the field should begin with, or a RegExp to test
-against the field. anyMatch : Boolean(optional) true to match any part not just the beginning caseSensitive : Boolean(optional) true for case sensitive comparison Returns: | Store | | filterBy( Function fn , [Object scope ] )
+ voidEnables events fired by this Observable to bubble up an owner hierarchy by calling
+this.getBubbleTarget() if present.... Enables events fired by this Observable to bubble up an owner hierarchy by calling
+this.getBubbleTarget() if present. There is no implementation in the Observable base class.
+ This is commonly used by Ext.Components to bubble events to owner Containers. See Ext.Component.getBubbleTarget. The default
+implementation in Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to
+access the required target more quickly.
+ Example: Ext.override(Ext.form.Field, {
+ // Add functionality to Field's initComponent to enable the change event to bubble
+ initComponent : Ext.form.Field.prototype.initComponent.createSequence(function() {
+ this.enableBubble('change');
+ }),
+
+ // We know that we want Field's events to bubble directly to the FormPanel.
+ getBubbleTarget : function() {
+ if (!this.formPanel) {
+ this.formPanel = this.findParentByType('form');
+ }
+ return this.formPanel;
+ }
+});
+
+var myForm = new Ext.formPanel({
+ title: 'User Details',
+ items: [{
+ ...
+ }],
+ listeners: {
+ change: function() {
+ // Title goes red if form has been modified.
+ myForm.header.setStyle('color', 'red');
+ }
+ }
+});
| Observable | | filter( String|Array field , String/RegExp value , [Boolean anyMatch ], [Boolean caseSensitive ], Boolean exactMatch )
+ :
+ voidFilter the records by a specified property. Alternatively, pass an array of filter
+options to filter by more than one... Filter the records by a specified property. Alternatively, pass an array of filter
+options to filter by more than one property.
+Single filter example:
+store.filter('name', 'Ed', true, true); //finds all records containing the substring 'Ed'
+Multiple filter example:
+ store.filter([
+{
+property : 'name',
+value : 'Ed',
+anyMatch : true, //optional, defaults to true
+caseSensitive: true //optional, defaults to true
+},
+//filter functions can also be passed
+{
+fn : function(record) {
+return record.get('age') == 24
+},
+scope: this
+}
+]);
Parameters:field : String|ArrayA field on your records, or an array containing multiple filter options value : String/RegExpEither a string that the field should begin with, or a RegExp to test
+against the field. anyMatch : Boolean(optional) true to match any part not just the beginning caseSensitive : Boolean(optional) true for case sensitive comparison exactMatch : BooleanTrue to force exact match (^ and $ characters added to the regex). Defaults to false. Ignored if anyMatch is true. Returns: | Store | | filterBy( Function fn , [Object scope ] )
:
voidFilter by a function. The specified function will be called for each
Record in this Store. If the function returns tr... Filter by a function. The specified function will be called for each
@@ -420,7 +446,7 @@ must contain the dataset size. For remote data sources, the value for this prope
by the Proxy.
<p><b>Note</b>: this value is not updated when changing the contents of the Store locally.</p> | Store | | groupBy( String field , [Boolean forceRegroup ] )
:
- voidGroups the data by the specified field. Groups the data by the specified field. | GroupingStore | | hasListener( String eventName )
:
BooleanChecks to see if this object has any listeners for a specified event Checks to see if this object has any listeners for a specified event | Observable | | indexOf( Ext.data.Record record )
@@ -473,7 +499,13 @@ that Reader'
the existing cache.
Note: that Records in a Store are keyed by their id, so added Records
with ids which are already present in the Store will replace existing Records. Only Records with
-new, unique ids will be added.Returns: | Store | | on( String eventName , Function handler , [Object scope ], [Object options ] )
+new, unique ids will be added.Returns: | Store | | multiSort( Array sorters , String direction )
+ :
+ voidSorts the contents of this store by multiple field/direction sorters. This is called internally by sort
+and would not... Sorts the contents of this store by multiple field/direction sorters. This is called internally by sort
+and would not usually be called manually.
+Multi sorting only currently applies to local datasets - multiple sort data is not currently sent to a proxy
+if remoteSort is used. | Store | | on( String eventName , Function handler , [Object scope ], [Object options ] )
:
voidAppends an event handler to this object (shorthand for addListener.) Appends an event handler to this object (shorthand for addListener.) Parameters:eventName : StringThe type of event to listen for handler : FunctionThe method the event invokes scope : Object(optional) The scope (this reference) in which the handler function is executed.
If omitted, defaults to the object which fired the event. options : Object(optional) An object containing handler configuration. Returns: | Observable | | purgeListeners()
@@ -539,12 +571,34 @@ if there are no items to save or the save was cancelled.
:
voidSet the value for a property name in this store's baseParams. Usage:myStore.setBaseParam('foo', {bar:3}); Set the value for a property name in this store's baseParams. Usage: myStore.setBaseParam('foo', {bar:3});
| Store | | setDefaultSort( String fieldName , [String dir ] )
:
- voidSets the default sort column and order to be used by the next load operation. Sets the default sort column and order to be used by the next load operation. Parameters:fieldName : StringThe name of the field to sort by. dir : String(optional) The sort order, 'ASC' or 'DESC' (case-sensitive, defaults to 'ASC') Returns: | Store | | sort( String fieldName , [String dir ] )
+ voidSets the default sort column and order to be used by the next load operation. Sets the default sort column and order to be used by the next load operation. Parameters:fieldName : StringThe name of the field to sort by. dir : String(optional) The sort order, 'ASC' or 'DESC' (case-sensitive, defaults to 'ASC') Returns: | Store | | singleSort( String fieldName , [String dir ] )
+ :
+ voidSorts the store contents by a single field and direction. This is called internally by sort and would
+not usually be ... Sorts the store contents by a single field and direction. This is called internally by sort and would
+not usually be called manually Parameters:fieldName : StringThe name of the field to sort by. dir : String(optional) The sort order, 'ASC' or 'DESC' (case-sensitive, defaults to 'ASC') Returns: | Store | | sort( String/Array fieldName , [String dir ] )
:
voidSort the Records.
If remote sorting is used, the sort is performed on the server, and the cache is reloaded. If local... Sort the Records.
If remote sorting is used, the sort is performed on the server, and the cache is reloaded. If local
-sorting is used, the cache is sorted internally. See also remoteSort and paramNames. Parameters:fieldName : StringThe name of the field to sort by. dir : String(optional) The sort order, 'ASC' or 'DESC' (case-sensitive, defaults to 'ASC') Returns: | Store | | sum( String property , [Number start ], [Number end ] )
+sorting is used, the cache is sorted internally. See also remoteSort and paramNames.
+This function accepts two call signatures - pass in a field name as the first argument to sort on a single
+field, or pass in an array of sort configuration objects to sort by multiple fields.
+Single sort example:
+store.sort('name', 'ASC');
+Multi sort example:
+store.sort([
+{
+field : 'name',
+direction: 'ASC'
+},
+{
+field : 'salary',
+direction: 'DESC'
+}
+], 'ASC');
+In this second form, the sort configs are applied in order, with later sorters sorting within earlier sorters' results.
+For example, if two records with the same name are present they will also be sorted by salary if given the sort configs
+above. Any number of sort configs can be added.Parameters:fieldName : String/ArrayThe name of the field to sort by, or an array of ordered sort configs dir : String(optional) The sort order, 'ASC' or 'DESC' (case-sensitive, defaults to 'ASC') Returns: | Store | | sum( String property , [Number start ], [Number end ] )
:
NumberSums the value of property for each record between start
and end and returns the result. Sums the value of property for each record between start
@@ -563,8 +617,8 @@ false the load action will b... Fires before a request is
( Ext.data.Store store , Object data )
Fires before a save action is called. A save encompasses destroying records, updating records and creating records. Fires before a save action is called. A save encompasses destroying records, updating records and creating records. Listeners will be called with the following arguments: | Store | | beforewrite :
- ( Ext.data.Store store , String action , Record/Array[Record] rs , Object options , Object arg )
- Listeners will be called with the following arguments: | Store | | clear :
+ ( Ext.data.Store store , String action , Record/Record[] rs , Object options , Object arg )
+ Listeners will be called with the following arguments: | Store | | clear :
( Store this , Record[] The )
Fires when the data cache has been cleared. Fires when the data cache has been cleared. Listeners will be called with the following arguments: | Store | | datachanged :
( Store this )
@@ -577,7 +631,9 @@ This event is relayed through the corresponding Ex... | Store | | load :
+for description. | Store | | groupchange :
+ ( Ext.data.GroupingStore store , String groupField )
+ Fired whenever a call to store.groupBy successfully changes the grouping on the store Fired whenever a call to store.groupBy successfully changes the grouping on the store Listeners will be called with the following arguments: | GroupingStore | | load :
( Store this , Ext.data.Record[] records , Object options )
Fires after a new set of Records has been loaded. Fires after a new set of Records has been loaded. Listeners will be called with the following arguments: | Store | | loadexception :
( misc misc )
|
|