class type t =Inheritsobject
..end
method currentPage : Js.number Js.t Js.prop
The page that the Store has most recently loaded (see loadPage)
Defaults to: 1
method data : 'a. 'a Js.t Js.prop
When this Store is not buffered, the data
property is a MixedCollection which holds this store's local cache of records.
When this store is buffered, the data
property is a cache of pages of records used to satisfy load requests from the Store when the associated view
scrolls. Depending on how the buffer zone and purgePageCount are configured,
pages which are scrolled out of view may be evicted from the cache, and need to be re-requested from the server
when scrolled back into view. For this reason, if using buffered, it is recommended that you configure
your Model definitions with a unique Ext.data.Model.idProperty so that records which return to the page
cache may be matched against previously selected records.
Pages in the direction of scroll are prefetched from the remote server and loaded into this cache before they are needed based upon the buffer zone so that scrolling can proceed without visible pauses for data loading.
method snapshot : Ext_util_MixedCollection.t Js.t Js.prop
A pristine (unfiltered) collection of the records in this store. This is used to reinstate records when a filter is removed or changed
method add : 'b. 'b Js.t -> Ext_data_Model.t Js.js_array Js.t Js.meth
Adds Model instance to the Store. This method accepts either:
The new Model instances will be added at the end of the existing collection.
Sample usage:
myStore.add({some: 'data'}, {some: 'other data'});
Note that if this Store is sorted, the new Model instances will be inserted at the correct point in the Store to maintain the sort order.
Parameters:
_ Js.t
An array of Model instances or Model configuration objects, or variable number of Model instance or config arguments.
Returns:
Ext_data_Model.t Js.js_array Js.t
The model instances that were added
method addFilter : 'c. 'c Js.t -> bool Js.t Js.optdef -> unit Js.meth
Adds a new Filter to this Store's filter set and by default, applys the updated filter set to the Store's unfiltered dataset.
Parameters:
_ Js.t
The set of filters to add to the current filter set.
bool Js.t
(optional)
Pass as false
to add the filter but not apply the updated filter set.
method addSorted : Ext_data_Model.t Js.t -> unit Js.meth
(Local sort only) Inserts the passed Record into the Store at the index where it should go based on the current sort information.
Parameters:
Ext_data_Model.t Js.t
method aggregate : 'd 'e 'f 'g.
'd Js.callback ->
'e Js.t Js.optdef ->
bool Js.t Js.optdef -> 'f Js.js_array Js.t Js.optdef -> 'g Js.t Js.meth
Runs the aggregate function for all the records in the store.
When store is filtered, only items within the filter are aggregated.
Parameters:
_ Js.callback
The function to execute. The function is called with a single parameter, an array of records for that group.
_ Js.t
(optional)
The scope to execute the function in. Defaults to the store.
bool Js.t
(optional)
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.
_ Js.js_array Js.t
(optional)
Any arguments to append to the function call
Returns:
_ Js.t
An object literal with the group names and their appropriate values.
method average : 'h. Js.js_string Js.t -> bool Js.t Js.optdef -> 'h Js.t Js.meth
Gets the average value in the store.
When store is filtered, only items within the filter are aggregated.
Parameters:
Js.js_string Js.t
The field in each record
bool Js.t
(optional)
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.
Returns:
_ Js.t
The average value, if no items exist, 0.
method clearFilter : bool Js.t Js.optdef -> unit Js.meth
Reverts to a view of the Record cache with no filtering applied.
Parameters:
bool Js.t
(optional)
If true
the filter is cleared silently.
For a locally filtered Store, this means that the filter collection is cleared without firing the datachanged event.
For a remotely filtered Store, this means that the filter collection is cleared, but the store is not reloaded from the server.
method clearGrouping : unit Js.meth
Clear any groupers in the store
method collect : 'i.
Js.js_string Js.t ->
bool Js.t Js.optdef ->
bool Js.t Js.optdef -> 'i Js.t Js.js_array Js.t Js.meth
Collects unique values for a particular dataIndex from this store.
Parameters:
Js.js_string Js.t
The property to collect
bool Js.t
(optional)
Pass true to allow null, undefined or empty string values
bool Js.t
(optional)
Pass true to collect from all records, even ones which are filtered.
Returns:
_ Js.t Js.js_array Js.t
An array of the unique values
method commitChanges : unit Js.meth
Commits 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.
method count : bool Js.t Js.optdef -> Js.number Js.t Js.meth
Gets the count of items in the store.
When store is filtered, only items within the filter are counted.
Parameters:
bool Js.t
(optional)
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.
Returns:
Js.number Js.t
the count
method each : 'j 'k. 'j Js.callback -> 'k Js.t Js.optdef -> unit Js.meth
Calls the specified function for each record in the store.
When store is filtered, only loops over the filtered records.
Parameters:
_ Js.callback
The function to call. The Record is passed as the first parameter.
Returning false
aborts and exits the iteration.
_ Js.t
(optional)
The scope (this reference) in which the function is executed. Defaults to the current record in the iteration.
method filter : 'l. 'l Js.t Js.optdef -> Js.js_string Js.t Js.optdef -> unit Js.meth
Filters the loaded set of records by a given set of filters.
By default, the passed filter(s) are added to the collection of filters being used to filter this Store.
To remove existing filters before applying a new set of filters use
// Clear the filter collection without updating the UI
store.clearFilter(true);
see clearFilter.
Alternatively, if filters are configured with an id
, then existing filters store may be replaced by new
filters having the same id
.
Filtering by single field:
store.filter("email", /\.com$/);
Using multiple filters:
store.filter([
{property: "email", value: /\.com$/},
{filterFn: function(item) { return item.get("age") > 10; }}
]);
Using Ext.util.Filter instances instead of config objects (note that we need to specify the root config option in this case):
store.filter([
Ext.create('Ext.util.Filter', {property: "email", value: /\.com$/, root: 'data'}),
Ext.create('Ext.util.Filter', {filterFn: function(item) { return item.get("age") > 10; }, root: 'data'})
]);
When store is filtered, most of the methods for accessing store data will be working only within the set of filtered records. Two notable exceptions are queryBy and getById.
Parameters:
_ Js.t
(optional)
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.
If no parameters are passed, the Store's existing filter set is applied.
Js.js_string Js.t
(optional)
value to filter by (only if using a property string as the first argument)
method filterBy : 'm 'n. 'm Js.callback -> 'n Js.t Js.optdef -> unit Js.meth
Filters 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.
When store is filtered, most of the methods for accessing store data will be working only within the set of filtered records. Two notable exceptions are queryBy and getById.
Parameters:
_ Js.callback
The function to be called. It will be passed the following parameters:
_ Js.t
(optional)
The scope (this reference) in which the function is executed. Defaults to this Store.
method find : 'o.
Js.js_string Js.t ->
'o Js.t ->
Js.number Js.t Js.optdef ->
bool Js.t Js.optdef ->
bool Js.t Js.optdef -> bool Js.t Js.optdef -> Js.number Js.t Js.meth
Finds the index of the first matching Record in this store by a specific field value.
When store is filtered, finds records only within filter.
**IMPORTANT
If this store is buffered, this can ONLY find records which happen to be cached in the page cache. This will be parts of the dataset around the currently visible zone, or recently visited zones if the pages have not yet been purged from the cache.**
Parameters:
Js.js_string Js.t
The name of the Record field to test.
_ Js.t
Either a string that the field value should begin with, or a RegExp to test against the field.
Js.number Js.t
(optional)
The index to start searching at
Defaults to: 0bool Js.t
(optional)
True to match any part of the string, not just the beginning
Defaults to: falsebool Js.t
(optional)
True for case sensitive comparison
Defaults to: falsebool Js.t
(optional)
True to force exact match (^ and $ characters added to the regex).
Defaults to: falseReturns:
Js.number Js.t
The matched index or -1
method findBy : 'p 'q.
'p Js.callback ->
'q Js.t Js.optdef -> Js.number Js.t Js.optdef -> Js.number Js.t Js.meth
Find the index of the first matching Record in this Store by a function.
If the function returns true
it is considered a match.
When store is filtered, finds records only within filter.
**IMPORTANT
If this store is buffered, this can ONLY find records which happen to be cached in the page cache. This will be parts of the dataset around the currently visible zone, or recently visited zones if the pages have not yet been purged from the cache.**
Parameters:
_ Js.callback
The function to be called. It will be passed the following parameters:
_ Js.t
(optional)
The scope (this reference) in which the function is executed. Defaults to this Store.
Js.number Js.t
(optional)
The index to start searching at
Defaults to: 0Returns:
Js.number Js.t
The matched index or -1
method findExact : 'r.
Js.js_string Js.t ->
'r Js.t -> Js.number Js.t Js.optdef -> Js.number Js.t Js.meth
Finds the index of the first matching Record in this store by a specific field value.
When store is filtered, finds records only within filter.
**IMPORTANT
If this store is buffered, this can ONLY find records which happen to be cached in the page cache. This will be parts of the dataset around the currently visible zone, or recently visited zones if the pages have not yet been purged from the cache.**
Parameters:
Js.js_string Js.t
The name of the Record field to test.
_ Js.t
The value to match the field against.
Js.number Js.t
(optional)
The index to start searching at
Defaults to: 0Returns:
Js.number Js.t
The matched index or -1
method findRecord : 's.
Js.js_string Js.t ->
's Js.t ->
Js.number Js.t Js.optdef ->
bool Js.t Js.optdef ->
bool Js.t Js.optdef -> bool Js.t Js.optdef -> Ext_data_Model.t Js.t Js.meth
Finds the first matching Record in this store by a specific field value.
When store is filtered, finds records only within filter.
**IMPORTANT
If this store is buffered, this can ONLY find records which happen to be cached in the page cache. This will be parts of the dataset around the currently visible zone, or recently visited zones if the pages have not yet been purged from the cache.**
Parameters:
Js.js_string Js.t
The name of the Record field to test.
_ Js.t
Either a string that the field value should begin with, or a RegExp to test against the field.
Js.number Js.t
(optional)
The index to start searching at
Defaults to: 0bool Js.t
(optional)
True to match any part of the string, not just the beginning
Defaults to: falsebool Js.t
(optional)
True for case sensitive comparison
Defaults to: falsebool Js.t
(optional)
True to force exact match (^ and $ characters added to the regex).
Defaults to: falseReturns:
Ext_data_Model.t Js.t
The matched record or null
method first : 't. bool Js.t Js.optdef -> 't Js.t Js.meth
Convenience function for getting the first model instance in the store.
When store is filtered, will return first item within the filter.
Parameters:
bool Js.t
(optional)
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.
Returns:
_ Js.t
The first model instance in the store, or undefined
method getAt : Js.number Js.t -> Ext_data_Model.t Js.t Js.meth
Get the Record at the specified index.
The index is effected by filtering.
Parameters:
Js.number Js.t
The index of the Record to find.
Returns:
Ext_data_Model.t Js.t
The Record at the passed index. Returns undefined if not found.
method getById : 'u. 'u Js.t -> Ext_data_Model.t Js.t Js.meth
Get the Record with the specified id.
This method is not effected by filtering, lookup will be performed from all records inside the store, filtered or not.
Parameters:
_ Js.t
The id of the Record to find.
Returns:
Ext_data_Model.t Js.t
The Record with the passed id. Returns null if not found.
method getCount : Js.number Js.t Js.meth
Gets the number of records in store.
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.
When store is filtered, it's the number of records matching the filter.
Returns:
Js.number Js.t
The number of Records in the Store.
method getGroupString : Ext_data_Model.t Js.t -> Js.js_string Js.t Js.meth
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:
Ext.create('Ext.data.Store', {
groupDir: 'ASC',
getGroupString: function(instance) {
return instance.get('name')[0];
}
});
Parameters:
Ext_data_Model.t Js.t
The model instance
Returns:
Js.js_string Js.t
The string to compare when forming groups
method getGroups : 'v. Js.js_string Js.t Js.optdef -> 'v Js.t Js.meth
Returns an array containing the result of applying grouping to the records in this store. See groupField, groupDir and getGroupString. Example for a store containing records with a color field:
var myStore = Ext.create('Ext.data.Store', {
groupField: 'color',
groupDir : 'DESC'
});
myStore.getGroups(); // returns:
[
{
name: 'yellow',
children: [
// all records where the color field is 'yellow'
]
},
{
name: 'red',
children: [
// all records where the color field is 'red'
]
}
]
Group contents are effected by filtering.
Parameters:
Js.js_string Js.t
(optional)
Pass in an optional groupName argument to access a specific group as defined by getGroupString.
Returns:
_ Js.t
The grouped data
method getNewRecords : Ext_data_Model.t Js.js_array Js.t Js.meth
inherit docs
Returns all Model instances that are either currently a phantom (e.g. have no id), or have an ID but have not yet been saved on this Store (this happens when adding a non-phantom record from another Store into this one)
Returns:
Ext_data_Model.t Js.js_array Js.t
The Model instances
method getPageFromRecordIndex : Js.number Js.t -> Js.number Js.t Js.meth
Determines the page from a record index
Parameters:
Js.number Js.t
The record index
Returns:
Js.number Js.t
The page the record belongs to
method getRange : 'w.
Js.number Js.t ->
Js.number Js.t ->
'w Js.t Js.optdef -> Ext_data_Model.t Js.js_array Js.t Js.meth
Gathers a range of Records between specified indices.
If this store is buffered, the indices are relative to the entire dataset, not the local record cache.
If this store is buffered, then the requested data range may not be immediately available, and will be returned through a passed callback function.
This method is affected by filtering.
Parameters:
Js.number Js.t
The starting index. Defaults to zero for non buffered Stores.
Js.number Js.t
The ending index. Defaults to the last Record for non buffered Stores.
_ Js.t
(optional)
Used when the Store is {@link buffered] and the range may not be available synchronously.
Returns:
Ext_data_Model.t Js.js_array Js.t
An array of records if the records are immediately available. For buffered stores, you should pass the callback option unless you know that the range will be present - see rangeCached.
method getTotalCount : Js.number Js.t Js.meth
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
Returns:
Js.number Js.t
The total number of Model instances available via the Proxy. 0 returned if no value has been set via the reader.
method getUpdatedRecords : Ext_data_Model.t Js.js_array Js.t Js.meth
inherit docs
Returns all Model instances that have been updated in the Store but not yet synchronized with the Proxy
Returns:
Ext_data_Model.t Js.js_array Js.t
The updated Model instances
method group : 'x. 'x Js.t -> Js.js_string Js.t Js.optdef -> unit Js.meth
Groups data inside the store.
Parameters:
_ Js.t
Either a string name of one of the fields in this Store's configured Model, or an Array of grouper configurations.
Js.js_string Js.t
(optional)
The overall direction to group the data by.
Defaults to: "ASC"method indexOf : Ext_data_Model.t Js.t -> Js.number Js.t Js.meth
Get the index of the record within the store.
When store is filtered, records outside of filter will not be found.
Parameters:
Ext_data_Model.t Js.t
The Ext.data.Model object to find.
Returns:
Js.number Js.t
The index of the passed Record. Returns -1 if not found.
method indexOfId : Js.js_string Js.t -> Js.number Js.t Js.meth
Get the index within the store of the Record with the passed id.
Like indexOf, this method is effected by filtering.
Parameters:
Js.js_string Js.t
The id of the Record to find.
Returns:
Js.number Js.t
The index of the Record. Returns -1 if not found.
method indexOfTotal : Ext_data_Model.t Js.t -> Js.number Js.t Js.meth
Get the index within the entire dataset. From 0 to the totalCount.
Like indexOf, this method is effected by filtering.
Parameters:
Ext_data_Model.t Js.t
The Ext.data.Model object to find.
Returns:
Js.number Js.t
The index of the passed Record. Returns -1 if not found.
method insert : Js.number Js.t ->
Ext_data_Model.t Js.js_array Js.t ->
Ext_data_Model.t Js.js_array Js.t Js.meth
Inserts Model instances into the Store at the given index and fires the add event. See also add.
Parameters:
Js.number Js.t
The start index at which to insert the passed Records.
Ext_data_Model.t Js.js_array Js.t
An Array of Ext.data.Model objects to add to the store.
Returns:
Ext_data_Model.t Js.js_array Js.t
records The added records
method isFiltered : bool Js.t Js.meth
Returns true
if this store is currently filtered
method isGrouped : bool Js.t Js.meth
Checks if the store is currently grouped
Returns:
bool Js.t
true
if the store is grouped.
method last : 'y. bool Js.t Js.optdef -> 'y Js.t Js.meth
Convenience function for getting the last model instance in the store.
When store is filtered, will return last item within the filter.
Parameters:
bool Js.t
(optional)
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:
_ Js.t
The last model instance in the store, or undefined
method load_store : 'z. 'z Js.t Js.optdef -> unit Js.meth
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:
store.load({
scope: this,
callback: function(records, operation, success) {
// the operation object
// contains all of the details of the load operation
console.log(records);
}
});
If the callback scope does not need to be set, a function can simply be passed:
store.load(function(records, operation, success) {
console.log('loaded records');
});
Parameters:
_ Js.t
(optional)
config object, passed into the Ext.data.Operation object before loading.
Additionally addRecords: true
can be specified to add these records to the existing records, default is
to remove the Store's existing records first.
method loadData : 'a1. 'a1 Js.t -> bool Js.t Js.optdef -> unit Js.meth
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 or loadRawData.
Parameters:
_ Js.t
Array of data to load. Any non-model instances will be cast into model instances first.
bool Js.t
(optional)
true
to add the records to the existing records in the store, false
to remove the old ones first.
method loadPage : 'b1. Js.number Js.t -> 'b1 Js.t Js.optdef -> unit Js.meth
Loads a given 'page' of data by setting the start and limit values appropriately. Internally this just causes a normal load operation, passing in calculated 'start' and 'limit' params.
Parameters:
Js.number Js.t
The number of the page to load.
_ Js.t
(optional)
See options for load.
method loadRawData : 'c1. 'c1 Js.t Js.js_array Js.t -> bool Js.t Js.optdef -> unit Js.meth
Loads data via the bound Proxy's reader
Use this method if you are attempting to load data and want to utilize the configured data reader.
Parameters:
_ Js.t Js.js_array Js.t
The full JSON object you'd like to load into the Data store.
bool Js.t
(optional)
true
to add the records to the existing records in the store, false
to remove the old ones first.
method loadRecords : 'd1. Ext_data_Model.t Js.js_array Js.t -> 'd1 Js.t -> unit Js.meth
Loads an array of model instances into the store, fires the datachanged event. This should only usually be called internally when loading from the Proxy, when adding records manually use add instead
Parameters:
Ext_data_Model.t Js.js_array Js.t
The array of records to load
_ Js.t
method max : 'e1. Js.js_string Js.t -> bool Js.t Js.optdef -> 'e1 Js.t Js.meth
Gets the maximum value in the store.
When store is filtered, only items within the filter are aggregated.
Parameters:
Js.js_string Js.t
The field in each record
bool Js.t
(optional)
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.
Returns:
_ Js.t
The maximum value, if no items exist, undefined.
method min : 'f1. Js.js_string Js.t -> bool Js.t Js.optdef -> 'f1 Js.t Js.meth
Gets the minimum value in the store.
When store is filtered, only items within the filter are aggregated.
Parameters:
Js.js_string Js.t
The field in each record
bool Js.t
(optional)
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.
Returns:
_ Js.t
The minimum value, if no items exist, undefined.
method nextPage : 'g1. 'g1 Js.t -> unit Js.meth
method prefetch : 'h1. 'h1 Js.t Js.optdef -> unit Js.meth
Prefetches data into the store using its configured proxy.
Parameters:
_ Js.t
(optional)
config object, passed into the Ext.data.Operation object before loading. See load
method prefetchPage : 'i1. Js.number Js.t -> 'i1 Js.t Js.optdef -> unit Js.meth
Prefetches a page of data.
Parameters:
Js.number Js.t
The page to prefetch
_ Js.t
(optional)
config object, passed into the Ext.data.Operation object before loading. See load
method prefetchRange : 'j1 'k1. 'j1 Js.t -> 'k1 Js.t -> unit Js.meth
Ensures that the specified range of rows is present in the cache.
Converts the row range to a page range and then only load pages which are not already present in the page cache.
Parameters:
_ Js.t
_ Js.t
method previousPage : 'l1. 'l1 Js.t -> unit Js.meth
method query : 'm1.
Js.js_string Js.t ->
'm1 Js.t ->
bool Js.t Js.optdef ->
bool Js.t Js.optdef ->
bool Js.t Js.optdef -> Ext_util_MixedCollection.t Js.t Js.meth
Query all the cached records in this Store by name/value pair. The parameters will be used to generated a filter function that is given to the queryBy method.
This method compliments queryBy by generating the query function automatically.
Parameters:
Js.js_string Js.t
The property to create the filter function for
_ Js.t
The string/regex to compare the property value to
bool Js.t
(optional)
true
if we don't care if the filter value is not the full value.
bool Js.t
(optional)
true
to create a case-sensitive regex.
bool Js.t
(optional)
true
to force exact match (^ and $ characters added to the regex).
Ignored if anyMatch
is true
.
Returns:
Ext_util_MixedCollection.t Js.t
Returns an Ext.util.MixedCollection of the matched records
method queryBy : 'n1 'o1.
'n1 Js.callback ->
'o1 Js.t Js.optdef -> Ext_util_MixedCollection.t Js.t Js.meth
Query all 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.
This method is not effected by filtering, it will always look from all records inside the store no matter if filter is applied or not.
Parameters:
_ Js.callback
The function to be called. It will be passed the following parameters:
_ Js.t
(optional)
The scope (this reference) in which the function is executed Defaults to this Store.
Returns:
Ext_util_MixedCollection.t Js.t
Returns an Ext.util.MixedCollection of the matched records
method rejectChanges : unit Js.meth
Rejects outstanding changes on all modified records and re-insert any records that were removed locally. Any phantom records will be removed.
method reload : 'p1. 'p1 Js.t -> unit Js.meth
Reloads the store using the last options passed to the load method.
Parameters:
_ Js.t
A config object which contains options which may override the options passed to the previous load call.
method remove : 'q1. 'q1 Js.t -> unit Js.meth
Removes the specified record(s) from the Store, firing the remove event for each instance that is removed.
A bulkremove event is called at the end passing all removed records and their indices. plus a single 'datachanged' event after removal.
Parameters:
_ Js.t
Model instance or array of instances to remove or an array of indices from which to remove records.
method removeAll_bool : bool Js.t Js.optdef -> unit Js.meth
Removes all items from the store.
Individual record remove
events are not fired by this method.
Parameters:
bool Js.t
(optional)
Pass true
to prevent the record bulkremove
and clear
events from being fired.
method removeAt : Js.number Js.t -> Js.number Js.t Js.optdef -> unit Js.meth
Removes the model instance(s) at the given index
Parameters:
Js.number Js.t
The record index
Js.number Js.t
(optional)
The number of records to delete
Defaults to: 1method removeFilter : 'r1. 'r1 Js.t -> bool Js.t Js.optdef -> unit Js.meth
Removes an individual Filter from the current filter set using the passed Filter/Filter id and by default, applys the updated filter set to the Store's unfiltered dataset.
Parameters:
_ Js.t
The id of a Filter to remove from the filter set, or a Filter instance to remove.
bool Js.t
(optional)
Pass as false
to remove the filter but not apply the updated filter set.
If null
is passed, all anonymous Filters (Filters with no id
property) will be removed.
method sort : 's1.
's1 Js.t Js.optdef ->
Js.js_string Js.t Js.optdef -> Ext_util_Sorter.t Js.js_array Js.t Js.meth
because prefetchData is stored by index this invalidates all of the prefetchedData
Sorts the data in the Store by one or more of its properties. Example usage:
//sort by a single field
myStore.sort('myField', 'DESC');
//sorting by multiple fields
myStore.sort([
{
property : 'age',
direction: 'ASC'
},
{
property : 'name',
direction: 'DESC'
}
]);
Internally, Store converts the passed arguments into an array of Ext.util.Sorter instances, and delegates the actual sorting to its internal Ext.util.MixedCollection.
When passing a single string argument to sort, Store maintains a ASC/DESC toggler per field, so this code:
store.sort('myField');
store.sort('myField');
Is equivalent to this code, because Store handles the toggling automatically:
store.sort('myField', 'ASC');
store.sort('myField', 'DESC');
Parameters:
_ Js.t
(optional)
Either a string name of one of the fields in this Store's configured Model, or an array of sorter configurations.
Js.js_string Js.t
(optional)
The overall direction to sort the data by.
Defaults to: "ASC"method sum : Js.js_string Js.t -> bool Js.t Js.optdef -> Js.number Js.t Js.meth
Sums the value of field
for each record in store
and returns the result.
When store is filtered, only sums items within the filter.
Parameters:
Js.js_string Js.t
A field in each record
bool Js.t
(optional)
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.
Returns:
Js.number Js.t
The sum