|
| JsonStore( Object config )
+ | JsonStore |
| add( Ext.data.Record[] records )
+ :
+ voidAdd Records to the Store and fires the add event. To add Records
to the store from a remote source use load({add:tru... Add Records to the Store and fires the add event. To add Records
to the store from a remote source use load({add:true}) .
See also recordType and insert . Parameters:records : Ext.data.Record[]An Array of Ext.data.Record objects
-to add to the cache. See recordType. Returns: | Store |
| addEvents( Object|String o , string Optional. )
- :
+to add to the cache. See recordType.Returns: | Store |
| addEvents( Object|String o , string Optional. )
+ :
voidAdds the specified events to the list of events which this Observable may fire. Adds the specified events to the list of events which this Observable may fire. | Observable |
| addListener( String eventName , Function handler , [Object scope ], [Object options ] )
- :
+Usage:this.addEvents('storeloaded', 'storecleared'); Returns: | Observable |
| addListener( String eventName , Function handler , [Object scope ], [Object options ] )
+ :
voidAppends an event handler to this object. Appends an event handler to this object. Parameters:eventName : StringThe name of the 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.
properties. This may contain any of the following properties:
@@ -305,142 +309,162 @@ Or a shorthand syntax:
'mouseover' : this.onMouseOver,
'mouseout' : this.onMouseOut,
scope: this
-}); Returns: | Observable |
| addSorted( Ext.data.Record record )
- :
- void(Local sort only) Inserts the passed Record into the Store at the index where it
+}); Returns: | Observable |
| addSorted( Ext.data.Record record )
+ :
+ void(Local sort only) Inserts the passed Record into the Store at the index where it
should go based on the current sort ... (Local sort only) Inserts the passed Record into the Store at the index where it
-should go based on the current sort information. | Store |
| clearFilter( Boolean suppressEvent )
- :
+should go based on the current sort information. | Store |
| clearFilter( Boolean suppressEvent )
+ :
voidRevert to a view of the Record cache with no filtering applied. Revert to a view of the Record cache with no filtering applied. Parameters:suppressEvent : BooleanIf true the filter is cleared silently without firing the
- datachanged event. Returns: | Store |
| collect( String dataIndex , [Boolean allowNull ], [Boolean bypassFilter ] )
- :
- ArrayCollects unique values for a particular dataIndex from this store. Collects unique values for a particular dataIndex from this store. Parameters:dataIndex : StringThe property to collect allowNull : Boolean(optional) Pass true to allow null, undefined or empty string values bypassFilter : Boolean(optional) Pass true to collect from all records, even ones which are filtered Returns: | Store |
| commitChanges()
- :
- voidCommit all Records with outstanding changes. To handle updates for changes,
+ datachanged event. Returns: | Store |
| collect( String dataIndex , [Boolean allowNull ], [Boolean bypassFilter ] )
+ :
+ ArrayCollects unique values for a particular dataIndex from this store. Collects unique values for a particular dataIndex from this store. Parameters:dataIndex : StringThe property to collect allowNull : Boolean(optional) Pass true to allow null, undefined or empty string values bypassFilter : Boolean(optional) Pass true to collect from all records, even ones which are filtered Returns: | Store |
| commitChanges()
+ :
+ voidCommit all Records with outstanding changes. To handle updates for changes,
subscribe to the Store's update event, an... Commit all Records with outstanding changes. To handle updates for changes,
subscribe to the Store's update event, and perform updating when the third parameter is
-Ext.data.Record.COMMIT. | Store |
| destroy()
- :
- void | Store |
| each( Function fn , [Object scope ] )
- :
+Ext.data.Record.COMMIT. | Store |
| destroy()
+ :
+ void | Store |
| each( Function fn , [Object scope ] )
+ :
voidCalls the specified function for each of the Records in the cache. Calls the specified function for each of the Records in the cache. Parameters:fn : FunctionThe function to call. The Record is passed as the first parameter.
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 ] )
- :
- voidFilter by a function. The specified function will be called for each
+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|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
Record in this Store. If the function returns true the Record is included,
otherwise it is filtered out. | Store |
| find( String fieldName , String/RegExp value , [Number startIndex ], [Boolean anyMatch ], [Boolean caseSensitive ] )
- :
+scope : Object(optional) The scope (this reference) in which the function is executed. Defaults to this Store. Returns: | Store |
| find( String fieldName , String/RegExp value , [Number startIndex ], [Boolean anyMatch ], [Boolean caseSensitive ] )
+ :
NumberFinds the index of the first matching Record in this store by a specific field value. Finds the index of the first matching Record in this store by a specific field value. Parameters:fieldName : StringThe name of the Record field to test. value : String/RegExpEither a string that the field value
-should begin with, or a RegExp to test against the field. startIndex : Number(optional) The index to start searching at anyMatch : Boolean(optional) True to match any part of the string, not just the beginning caseSensitive : Boolean(optional) True for case sensitive comparison Returns:Number The matched index or -1
| Store |
| findBy( Function fn , [Object scope ], [Number startIndex ] )
- :
- NumberFind the index of the first matching Record in this Store by a function.
+should begin with, or a RegExp to test against the field. startIndex : Number(optional) The index to start searching at anyMatch : Boolean(optional) True to match any part of the string, not just the beginning caseSensitive : Boolean(optional) True for case sensitive comparison Returns:Number The matched index or -1
| Store |
| findBy( Function fn , [Object scope ], [Number startIndex ] )
+ :
+ NumberFind the index of the first matching Record in this Store by a function.
If the function returns true it is considere... Find the index of the first matching Record in this Store by a function.
If the function returns true it is considered a match. Parameters:Returns:Number The matched index or -1
| Store |
| findExact( String fieldName , Mixed value , [Number startIndex ] )
- :
- NumberFinds the index of the first matching Record in this store by a specific field value. Finds the index of the first matching Record in this store by a specific field value. Parameters:fieldName : StringThe name of the Record field to test. value : MixedThe value to match the field against. startIndex : Number(optional) The index to start searching at Returns:Number The matched index or -1
| Store |
| fireEvent( String eventName , Object... args )
- :
- BooleanFires the specified event with the passed parameters (minus the event name).
+ scope : Object(optional) The scope (this reference) in which the function is executed. Defaults to this Store. startIndex : Number(optional) The index to start searching at Returns:Number The matched index or -1
| Store |
| findExact( String fieldName , Mixed value , [Number startIndex ] )
+ :
+ NumberFinds the index of the first matching Record in this store by a specific field value. Finds the index of the first matching Record in this store by a specific field value. Parameters:fieldName : StringThe name of the Record field to test. value : MixedThe value to match the field against. startIndex : Number(optional) The index to start searching at Returns:Number The matched index or -1
| Store |
| fireEvent( String eventName , Object... args )
+ :
+ BooleanFires the specified event with the passed parameters (minus the event name).
An event may be set to bubble up an Obse... | Observable |
| getAt( Number index )
- :
- Ext.data.RecordGet the Record at the specified index. Get the Record at the specified index. | Store |
| getById( String id )
- :
- Ext.data.RecordGet the Record with the specified id. Get the Record with the specified id. | Store |
| getCount()
- :
- NumberGets the number of cached records.
+by calling enableBubble. | Observable |
| getAt( Number index )
+ :
+ Ext.data.RecordGet the Record at the specified index. Get the Record at the specified index. | Store |
| getById( String id )
+ :
+ Ext.data.RecordGet the Record with the specified id. Get the Record with the specified id. | Store |
| getCount()
+ :
+ NumberGets the number of cached records.
If using paging, this may not be the total size of the dataset. If the data object... Gets the number of cached records.
If using paging, this may not be the total size of the dataset. If the data object
used by the Reader contains the dataset size, then the getTotalCount function returns
-the dataset size. Note: see the Important note in load. | Store |
| getModifiedRecords()
- :
- Ext.data.Record[]Gets all records modified since the last commit. Modified records are
+the dataset size. Note: see the Important note in load. | Store |
| getModifiedRecords()
+ :
+ Ext.data.Record[]Gets all records modified since the last commit. Modified records are
persisted across load operations (e.g., during... | Store |
| getRange( [Number startIndex ], [Number endIndex ] )
- :
- Ext.data.Record[]Returns a range of Records between specified indices. Returns a range of Records between specified indices. Parameters:Returns:Ext.data.Record[] An array of Records
| Store |
| getSortState()
- :
- ObjectReturns an object describing the current sort state of this Store. Returns an object describing the current sort state of this Store. Parameters:Returns:Object The sort state of the Store. An object with two properties:<ul>
-<li><b>field : String<p class="sub-desc">The name of the field by which the Records are sorted.</p></li>
-<li><b>direction : String<p class="sub-desc">The sort order, 'ASC' or 'DESC' (case-sensitive).</p></li>
-</ul>
-See <tt>{@link #sortInfo}</tt> for additional details.
| Store |
| getTotalCount()
- :
- Number | Store |
| getRange( [Number startIndex ], [Number endIndex ] )
+ :
+ Ext.data.Record[]Returns a range of Records between specified indices. Returns a range of Records between specified indices. Parameters:Returns:Ext.data.Record[] An array of Records
| Store |
| getSortState()
+ :
+ ObjectReturns an object describing the current sort state of this Store. Returns an object describing the current sort state of this Store. Parameters:Returns:Object The sort state of the Store. An object with two properties:<ul>
+<li><b>field : String<p class="sub-desc">The name of the field by which the Records are sorted.</p></li>
+<li><b>direction : String<p class="sub-desc">The sort order, 'ASC' or 'DESC' (case-sensitive).</p></li>
+</ul>
+See <tt>{@link #sortInfo}</tt> for additional details.
| Store |
| getTotalCount()
+ :
+ NumberGets the total number of records in the dataset as returned by the server.
If using paging, for this to be accurate, ... Gets the total number of records in the dataset as returned by the server.
If using paging, for this to be accurate, the data object used by the Reader
must contain the dataset size. For remote data sources, the value for this property
(totalProperty for JsonReader,
totalRecords for XmlReader) shall be returned by a query on the server.
-Note: see the Important note in load. | Store |
| 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 )
- :
- NumberGet the index within the cache of the passed Record. Get the index within the cache of the passed Record. | Store |
| indexOfId( String id )
- :
- NumberGet the index within the cache of the Record with the passed id. Get the index within the cache of the Record with the passed id. | Store |
| insert( Number index , Ext.data.Record[] records )
- :
- voidInserts Records into the Store at the given index and fires the add event.
+ Note: see the Important note in load. | Store |
| 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 )
+ :
+ NumberGet the index within the cache of the passed Record. Get the index within the cache of the passed Record. | Store |
| indexOfId( String id )
+ :
+ NumberGet the index within the cache of the Record with the passed id. Get the index within the cache of the Record with the passed id. | Store |
| insert( Number index , Ext.data.Record[] records )
+ :
+ voidInserts Records into the Store at the given index and fires the add event.
See also add and addSorted. Inserts Records into the Store at the given index and fires the add event.
-See also add and addSorted . | Store |
| isFiltered()
- :
- BooleanReturns true if this store is currently filtered Returns true if this store is currently filtered | Store |
| load( Object options )
- :
- BooleanLoads the Record cache from the configured proxy using the configured reader.
-Notes:<div class="mdetail-params">
+See also add and addSorted . | Store |
| isFiltered()
+ :
+ BooleanReturns true if this store is currently filtered Returns true if this store is currently filtered | Store |
| load( Object options )
+ :
+ BooleanLoads the Record cache from the configured proxy using the configured reader.
+Notes:<div class="mdetail-params">
Impo... Loads the Record cache from the configured proxy using the configured reader.
Notes:
- Important: loading is asynchronous! This call will return before the new data has been
@@ -466,10 +490,10 @@ have been loaded. The callback is called after the load event is fired, and is p
to the Store object)
add : BooleanIndicator to append loaded records rather than
replace the current cache. Note: see note for loadData
- Returns: | Store |
| loadData( Object data , [Boolean append ] )
- :
- voidLoads data from a passed data block and fires the load event. A Reader
+ Returns: | Store |
| loadData( Object data , [Boolean append ] )
+ :
+ voidLoads data from a passed data block and fires the load event. A Reader
which understands the format of the data must ... Loads data from a passed data block and fires the load event. A Reader
which understands the format of the data must have been configured in the constructor. Parameters:data : ObjectThe data block from which to read the Records. The format of the data expected
is dependent on the type of Reader that is configured and should correspond to
@@ -477,30 +501,36 @@ 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()
- :
- voidRemoves all listeners for this object Removes all listeners for this object | Observable |
| query( String field , String/RegExp value , [Boolean anyMatch ], [Boolean caseSensitive ] )
- :
+If omitted, defaults to the object which fired the event.options : Object(optional) An object containing handler configuration. Returns: | Observable |
| purgeListeners()
+ :
+ voidRemoves all listeners for this object Removes all listeners for this object | Observable |
| query( String field , String/RegExp value , [Boolean anyMatch ], [Boolean caseSensitive ] )
+ :
MixedCollectionQuery the records by a specified property. Query 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 |
| queryBy( Function fn , [Object scope ] )
- :
- MixedCollectionQuery the cached records in this Store using a filtering function. The specified function
+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 |
| queryBy( Function fn , [Object scope ] )
+ :
+ MixedCollectionQuery the cached records in this Store using a filtering function. The specified function
will be called with each re... Query the cached records in this Store using a filtering function. The specified function
will be called with each record in this Store. If the function returns true the record is
included in the results. | Store |
| rejectChanges()
- :
- voidReject outstanding changes on all modified records. | Store |
| relayEvents( Object o , Array events )
- :
- voidRelays selected events from the specified Observable as if the events were fired by this. Relays selected events from the specified Observable as if the events were fired by this. | Observable |
| reload( Object options )
- :
- voidReloads the Record cache from the configured Proxy using the configured
+ scope : Object(optional) The scope (this reference) in which the function is executed. Defaults to this Store. Returns: | Store |
| rejectChanges()
+ :
+ voidReject outstanding changes on all modified records. | Store |
| relayEvents( Object o , Array events )
+ :
+ voidRelays selected events from the specified Observable as if the events were fired by this. Relays selected events from the specified Observable as if the events were fired by this. | Observable |
| reload( Object options )
+ :
+ voidReloads the Record cache from the configured Proxy using the configured
Reader and the options from the last load ope... Reloads the Record cache from the configured Proxy using the configured
Reader and the options from the last load operation
performed.
@@ -513,23 +543,23 @@ used).
Ext.apply(lastOptions.params, {
myNewParam: true
});
-myStore.reload(lastOptions); Returns: | Store |
| remove( Ext.data.Record/Ext.data.Record[] record )
- :
- voidRemove Records from the Store and fires the remove event. Remove Records from the Store and fires the remove event. | Store |
| removeAll( Boolean silent )
- :
- voidRemove all Records from the Store and fires the clear event. Remove all Records from the Store and fires the clear event. | Store |
| removeAt( Number index )
- :
- voidRemove a Record from the Store at the specified index. Fires the remove event. Remove a Record from the Store at the specified index. Fires the remove event. | Store |
| removeListener( String eventName , Function handler , [Object scope ] )
- :
- voidRemoves an event handler. Removes an event handler. | Observable |
| resumeEvents()
- :
- voidResume firing events. (see suspendEvents)
-If events were suspended using the queueSuspended parameter, then all
+myStore.reload(lastOptions); Returns: | Store |
| remove( Ext.data.Record/Ext.data.Record[] record )
+ :
+ voidRemove Records from the Store and fires the remove event. Remove Records from the Store and fires the remove event. | Store |
| removeAll( Boolean silent )
+ :
+ voidRemove all Records from the Store and fires the clear event. Remove all Records from the Store and fires the clear event. | Store |
| removeAt( Number index )
+ :
+ voidRemove a Record from the Store at the specified index. Fires the remove event. Remove a Record from the Store at the specified index. Fires the remove event. | Store |
| removeListener( String eventName , Function handler , [Object scope ] )
+ :
+ voidRemoves an event handler. Removes an event handler. | Observable |
| resumeEvents()
+ :
+ voidResume firing events. (see suspendEvents)
+If events were suspended using the queueSuspended parameter, then all
event... Resume firing events. (see suspendEvents)
If events were suspended using the queueSuspended parameter, then all
-events fired during event suspension will be sent to any listeners now. | Observable |
| save()
- :
- NumberSaves all pending changes to the store. If the commensurate Ext.data.Api.actions action is not configured, then
+events fired during event suspension will be sent to any listeners now. | Observable |
| save()
+ :
+ NumberSaves all pending changes to the store. If the commensurate Ext.data.Api.actions action is not configured, then
the ... Saves all pending changes to the store. If the commensurate Ext.data.Api.actions action is not configured, then
the configured url will be used.
@@ -538,75 +568,97 @@ change url
removed records Ext.data.Api.actions.destroy
phantom records Ext.data.Api.actions.create
modified records Ext.data.Api.actions.update
- | Store |
| setBaseParam( String name , Mixed value )
- :
- 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 ] )
- :
- void | Store |
| setBaseParam( String name , Mixed value )
+ :
+ 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 |
| 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 ] )
- :
- NumberSums the value of property for each record between start
+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
-and end and returns the result. | Store |
| suspendEvents( Boolean queueSuspended )
- :
+and end and returns the result. | Store |
| suspendEvents( Boolean queueSuspended )
+ :
voidSuspend the firing of all events. (see resumeEvents) Suspend the firing of all events. (see resumeEvents) Parameters:queueSuspended : BooleanPass as true to queue up suspended events to be fired
-after the resumeEvents call instead of discarding all suspended events; Returns: | Observable |
| un( String eventName , Function handler , [Object scope ] )
- :
- voidRemoves an event handler (shorthand for removeListener.) | Observable |