In the example above we configured an AJAX proxy to load data from the url '/users.json'. We told our Proxy
to use a JsonReader to parse the response from the server into Model object -
see the docs on JsonReader for details.

Inline data

Stores can also load data inline. Internally, Store converts each of the objects we pass in as data
into Model instances:

Loading inline data using the method above is great if the data is in the correct format already (e.g. it doesn't need
to be processed by a reader). If your inline data requires processing to decode the data structure,
use a MemoryProxy instead (see the MemoryProxy docs for an example).

Applications often need to load sets of associated data - for example a CRM system might load a User and her Orders.
Instead of issuing an AJAX request for the User and a series of additional AJAX requests for each Order, we can load a nested dataset
and allow the Reader to automatically populate the associated models. Below is a brief example, see the Ext.data.reader.Reader intro
docs for a full explanation:

Stores can be sorted and filtered - in both cases either remotely or locally. The sorters and filters are
held inside MixedCollection instances to make them easy to manage. Usually it is sufficient to
either just specify sorters and filters in the Store configuration or call sort or filter:

The new Store will keep the configured sorters and filters in the MixedCollection instances mentioned above. By default, sorting
and filtering are both performed locally by the Store - see remoteSort and remoteFilter to allow the server to
perform these operations instead.

Filtering and sorting after the Store has been instantiated is also easy. Calling filter adds another filter to the Store
and automatically filters the dataset (calling filter with no arguments simply re-applies all existing filters). Note that by
default sortOnFilter is set to true, which means that your sorters are automatically reapplied if using local sorting.

Note that all existing sorters will be removed in favor of the new sorter data (if sort is called with no arguments,
the existing sorters are just reapplied instead of being removed). To keep existing sorters and add new ones, just add them
to the MixedCollection:

Config options

If data is not specified, and if autoLoad is true or an Object, this store's load method is automatically called
afte...

If data is not specified, and if autoLoad is true or an Object, this store's load method is automatically called
after creation. If the value of autoLoad is an Object, this Object will be passed to the store's load method.

True to empty the store when loading another page via loadPage,
nextPage or previousPage. ...

True to empty the store when loading another page via loadPage,
nextPage or previousPage. Setting to false keeps existing records, allowing
large data sets to be loaded one page at a time but rendered all together.

This may be used in place of specifying a model configuration. The fields should be a
set of Ext.data.Field configuration objects. The store will automatically create a Ext.data.Model
with these fields. In general this configuration option should be avoided, it exists for the purposes of
backwards compatibility. For anything more complicated, such as specifying a particular id property or
assocations, a Ext.data.Model should be defined and specified for the model
config.

A config object containing one or more event handlers to be added to this object during initialization. ...

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 addListener example for attaching multiple
handlers at once.

While some Ext JS Component classes export selected DOM events (e.g. "click", "mouseover" etc), this is usually
only done when extra value can be added. For example the DataView's itemclick event passing the node clicked on. To access DOM events directly from a
child element of a Component, we need to specify the element option to identify the Component property to add a
DOM listener to:

The number of pages to keep in the cache before purging additional records. ...

The number of pages to keep in the cache before purging additional records. A value of 0 indicates to never purge the prefetched data.
This option is only relevant when the buffered option is set to true.

True if the grouping should apply on the server side, false if it is local only. ...

True if the grouping should apply on the server side, false if it is local only. 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 information to the server.

Properties

Sets the updating behavior based on batch synchronization. 'operation' (the default) will update the Store's
internal representation of the data after each operation of the batch has completed, 'complete' will wait until
the entire batch has been completed before updating the Store's data. 'complete' is a good choice for local
storage proxies, 'operation' is better for remote proxies, where there is a comparatively high latency.

The field by which to group data in the store. Internally, grouping is very similar to sorting - the
groupField and groupDir are injected as the first sorter (see sort). Stores support a single
level of grouping, and groups can be fetched via the getGroups method.

A set of default values to be applied to every model instance added via insert or created via create. ...

A set of default values to be applied to every model instance added via insert or created via create.
This is used internally by associations to set foreign keys and other fields. See the Association classes source code
for examples. This should not need to be used by application developers.

Get the reference to the current class from which this object was instantiated. ...

Get the reference to the current class from which this object was instantiated. Unlike statics,
this.self is scope-dependent and it's meant to be used for dynamic inheritance. See statics
for a detailed comparison

The scope (this reference) in which the handler function is executed. If
omitted, defaults to the object which fired the event.

An object containing handler configuration.

Note: Unlike in ExtJS 3.x, the options object will also be passed as the last argument to every event handler.

This object may contain any of the following properties:

scope : Object

The scope (this reference) in which the handler function is executed. If omitted, defaults to the object
which fired the event.

delay : Number

The number of milliseconds to delay the invocation of the handler after the event fires.

single : Boolean

True to add a handler to handle just the next firing of the event, and then remove itself.

buffer : Number

Causes the handler to be scheduled to run in an Ext.util.DelayedTask delayed by the specified number of
milliseconds. If the event fires again within that time, the original handler is not invoked, but the new
handler is scheduled in its place.

target : Observable

Only call the handler if the event was fired on the target Observable, not if the event was bubbled up from a
child Observable.

element : String

This option is only valid for listeners bound to Components. The name of a Component
property which references an element to add a listener to.

This option is useful during Component construction to add DOM event listeners to elements of
Components which will exist only after the Component is rendered.
For example, to add a click listener to a Panel's body:

The function to execute. The function is called with a single parameter,
an array of records for that group.

The scope to execute the function in. Defaults to the store.

True to perform the operation for each group
in the store. The value returned will be an object literal with the key being the group
name and the group average being the value. The grouped parameter is only honored if
the store has a groupField.

Gets the average value in the store. ...

Gets the average value in the store.

Available since: 4.0.0

Parameters

The field in each record

True to perform the operation for each group
in the store. The value returned will be an object literal with the key being the group
name and the group average being the value. The grouped parameter is only honored if
the store has a groupField.

Fires

Gets the count of items in the store. ...

Gets the count of items in the store.

Available since: 4.0.0

Parameters

True to perform the operation for each group
in the store. The value returned will be an object literal with the key being the group
name and the count for each group being the value. The grouped parameter is only honored if
the store has a groupField.

The function to call. The Record is passed as the first parameter.
Returning false aborts and exits the iteration.

The scope (this reference) in which the function is executed.
Defaults to the current Record in the iteration.

Enables 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.

Available since: 1.1.0

Parameters

The set of filters to apply to the data. These are stored internally on the store,
but the filtering itself is done on the Store's MixedCollection. See
MixedCollection's filter method for filter syntax. Alternatively,
pass in a property string

Convenience function for getting the first model instance in the store ...

Convenience function for getting the first model instance in the store

Available since: 4.0.0

Parameters

True to perform the operation for each group
in the store. The value returned will be an object literal with the key being the group
name and the first record being the value. The grouped parameter is only honored if
the store has a groupField.

The id of the Record to find.

Returns

The Record with the passed id. Returns null if not found.

Gets the number of cached records. ...

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.

Available since: 4.0.0

Parameters

True to call sort before finding groups. Sorting is required to make grouping
function correctly so this should only be set to false if the Store is known to already be sorted correctly
(defaults to true)

Returns

The group data

Fires

guaranteedrange

totalcountchange

Returns the string to group on for a given model instance. ...

Returns the string to group on for a given model instance. The default implementation of this method returns
the model's groupField, but this can be overridden to group by an arbitrary string. For example, to
group by the first letter of a model's 'name' field, use the following code:

For a given set of records and a Grouper, returns an array of arrays - each of which is the set of records
matching a certain group.

Available since: 4.0.0

Parameters

This is used recursively to gather the records into the configured Groupers. ...

This is used recursively to gather the records into the configured Groupers. The data MUST have been sorted for
this to work properly (see getGroupData and getGroupsForGrouper) Most of the work is done by
getGroupsForGrouper - this function largely just handles the recursion.

Available since: 4.0.0

, see sum ...

, see sum

Available since: 4.0.0

Parameters

Returns the total number of Model instances that the Proxy
indicates exist. ...

Returns the total number of Model instances that the Proxy
indicates exist. This will usually differ from getCount when using paging - getCount returns the
number of records loaded into the Store at the moment, getTotalCount returns the number of records that
could be loaded into the Store if the Store contained all data

Convenience function for getting the last model instance in the store ...

Convenience function for getting the last model instance in the store

Available since: 4.0.0

Parameters

True to perform the operation for each group
in the store. The value returned will be an object literal with the key being the group
name and the last record being the value. The grouped parameter is only honored if
the store has a groupField.

Returns

The last model instance in the store, or undefined

Fires

Loads data into the Store via the configured proxy. ...

Loads data into the Store via the configured proxy. This uses the Proxy to make an
asynchronous call to whatever storage backend the Proxy uses, automatically adding the retrieved
instances into the Store and calling an optional callback if required. Example usage:

Fires

Loads an array of data straight into the Store. ...

Loads an array of data straight into the Store.

Using this method is great if the data is in the correct format already (e.g. it doesn't need to be
processed by a reader). If your data requires processing to decode the data structure, use a
MemoryProxy instead.

Gets the maximum value in the store. ...

Gets the maximum value in the store.

Available since: 4.0.0

Parameters

The field in each record

True to perform the operation for each group
in the store. The value returned will be an object literal with the key being the group
name and the maximum in the group being the value. The grouped parameter is only honored if
the store has a groupField.

Gets the minimum value in the store. ...

Gets the minimum value in the store.

Available since: 4.0.0

Parameters

The field in each record

True to perform the operation for each group
in the store. The value returned will be an object literal with the key being the group
name and the minimum in the group being the value. The grouped parameter is only honored if
the store has a groupField.

The scope (this reference) in which the handler function is executed. If
omitted, defaults to the object which fired the event.

An object containing handler configuration.

Note: Unlike in ExtJS 3.x, the options object will also be passed as the last argument to every event handler.

This object may contain any of the following properties:

scope : Object

The scope (this reference) in which the handler function is executed. If omitted, defaults to the object
which fired the event.

delay : Number

The number of milliseconds to delay the invocation of the handler after the event fires.

single : Boolean

True to add a handler to handle just the next firing of the event, and then remove itself.

buffer : Number

Causes the handler to be scheduled to run in an Ext.util.DelayedTask delayed by the specified number of
milliseconds. If the event fires again within that time, the original handler is not invoked, but the new
handler is scheduled in its place.

target : Observable

Only call the handler if the event was fired on the target Observable, not if the event was bubbled up from a
child Observable.

element : String

This option is only valid for listeners bound to Components. The name of a Component
property which references an element to add a listener to.

This option is useful during Component construction to add DOM event listeners to elements of
Components which will exist only after the Component is rendered.
For example, to add a click listener to a Panel's body:

Purge the least recently used records in the prefetch if the purgeCount
has been exceeded. ...

Purge the least recently used records in the prefetch if the purgeCount
has been exceeded.

Available since: 4.0.0

Query the cached records in this Store using a filtering function. ...

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.

because prefetchData is stored by index
this invalidates all of the prefetchedData

Available since: 1.1.0

Returns

Fires

guaranteedrange

totalcountchange

Get the reference to the class from which this object was instantiated. ...

Get the reference to the class from which this object was instantiated. Note that unlike self,
this.statics() is scope-independent and it always returns the class from which it was called, regardless of what
this points to during run-time

Sums 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.

Available since: 1.1.0

Parameters

A field in each record

True to perform the operation for each group
in the store. The value returned will be an object literal with the key being the group
name and the sum for that group being the value. The grouped parameter is only honored if
the store has a groupField.

Available since: 2.3.0

Parameters

Pass as true to queue up suspended events to be fired
after the resumeEvents call instead of discarding all suspended events.

Synchronizes the Store with its Proxy. ...

Synchronizes the Store with its Proxy. This asks the Proxy to batch together any new, updated
and deleted records in the store, updating the Store's internal representation of the records
as each operation completes.