Roo.util.Observable Roo.data.Store
Package: | Roo.data |
Defined In: | Roo/data/Store.js. |
Class: | Store |
Subclasses: | Roo.data.JsonStore, Roo.data.SimpleStore |
Extends: | Roo.util.Observable |
A Store object uses an implementation of {link Roo.data.DataProxy} to access a data object unless you call loadData() directly and pass in your data. The Store object
has no knowledge of the format of the data returned by the Proxy.
A Store object uses its configured implementation of {link Roo.data.DataReader} to create {link Roo.data.Record}
instances from the data object. These records are cached and made available through accessor functions.
Options | Defined By | |
---|---|---|
baseParams : Object
An object containing properties which are to be sent as parameters
on any HTTP request An object containing properties which are to be sent as parameters
on any HTTP request |
Roo.data.Store | |
data : Array
Inline data to be loaded when the store is initialized.
Inline data to be loaded when the store is initialized.
|
Roo.data.Store | |
isLocal : boolean
flag if data is locally available (and can be always looked up
without a remote query - used by combo/forms at present. flag if data is locally available (and can be always looked up
without a remote query - used by combo/forms at present. |
Roo.data.Store | |
listeners : Object
list of events and functions to call for this object,
For example :
list of events and functions to call for this object,
For example :
|
Roo.util.Observable | |
multiSort : Boolean
enable multi column sorting (sort is based on the order of columns, remote only at present)
enable multi column sorting (sort is based on the order of columns, remote only at present)
|
Roo.data.Store | |
proxy : Roo.data.DataProxy
The Proxy object which provides access to a data object.
The Proxy object which provides access to a data object.
|
Roo.data.Store | |
pruneModifiedRecords : boolean
True to clear all modified record information each time the store is
loaded or when a record is removed. True to clear all modified record information each time the store is
loaded or when a record is removed. (defaults to false). |
Roo.data.Store | |
reader : Roo.data.Reader
The Reader object which processes the data object and returns
an Array of Roo.data.record objects which are cached keyed by their id property. The Reader object which processes the data object and returns
an Array of Roo.data.record objects which are cached keyed by their id property. |
Roo.data.Store | |
remoteSort : boolean
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 in place (defaults to false). 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 in place (defaults to false). |
Roo.data.Store | |
sortInfo : Object
A config object in the format: {field: "fieldName", direction: "ASC|DESC"}
A config object in the format: {field: "fieldName", direction: "ASC|DESC"}
|
Roo.data.Store |
Method | Defined By | |
---|---|---|
new Roo.data.Store
(Object config)
Create a new Roo.data.Store
Create a new Roo.data.Store
|
||
add
(Roo.data.Record[] records)
Add Records to the Store and fires the add event.
Add Records to the Store and fires the add event.
|
Roo.data.Store | |
addEvents
(Object object)
Used to define events on this Observable
Used to define events on this Observable
|
Roo.util.Observable | |
Appends an event handler to this component
Appends an event handler to this component
|
Roo.util.Observable | |
clearFilter
(Boolean suppressEvent)
Revert to a view of the Record cache with no filtering applied.
Revert to a view of the Record cache with no filtering applied.
|
Roo.data.Store | |
Collects unique values for a particular dataIndex from this store.
Collects unique values for a particular dataIndex from this store.
|
Roo.data.Store | |
commitChanges
()
Commit all Records with outstanding changes.
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 Roo.data.Record.COMMIT. |
Roo.data.Store | |
Calls the specified function for each of the Records in the cache.
|
Roo.data.Store | |
Filter the records by a specified property.
|
Roo.data.Store | |
Filter by a function.
Filter by a function. The specified function will be called with each
record in this data source. If the function returns true the record is included, otherwise it is filtered. |
Roo.data.Store | |
Fires the specified event with the passed parameters (minus the event name).
|
Roo.util.Observable | |
getAt
(Number index)
:
Roo.data.Record
Get the Record at the specified index.
Get the Record at the specified index.
|
Roo.data.Store | |
getById
(String id)
:
Roo.data.Record
Get the Record with the specified id.
Get the Record with the specified id.
|
Roo.data.Store | |
getCount
()
Gets the number of cached records.
Gets the number of cached records.
|
Roo.data.Store | |
getModifiedRecords
()
:
Roo.data.Record[]
Gets all records modified since the last commit.
Gets all records modified since the last commit. Modified records are persisted across load operations
(e.g., during paging).
|
Roo.data.Store | |
Returns a range of Records between specified indices.
Returns a range of Records between specified indices.
|
Roo.data.Store | |
getSortState
()
Returns the sort state of the Store as an object with two properties:
Returns the sort state of the Store as an object with two properties:
|
Roo.data.Store | |
getTotalCount
()
Gets the total number of records in the dataset as returned by the server.
Gets the total number of records in the dataset as returned by the server.
|
Roo.data.Store | |
Roo.util.Observable | ||
indexOf
(Roo.data.Record record)
:
Number
Get the index within the cache of the passed Record.
Get the index within the cache of the passed Record.
|
Roo.data.Store | |
Roo.data.Store | ||
insert
(Number index, Roo.data.Record[] records)
Inserts Records to the Store at the given index and fires the add event.
Inserts Records to the Store at the given index and fires the add event.
|
Roo.data.Store | |
load
(Object options)
Loads the Record cache from the configured Proxy using the configured Reader.
Loads the Record cache from the configured Proxy using the configured Reader.
|
Roo.data.Store | |
Loads data from a passed data block.
Loads data from a passed data block. A Reader which understands the format of the data
must have been configured in the constructor.
|
Roo.data.Store | |
Appends an event handler to this element (shorthand for addListener)
Appends an event handler to this element (shorthand for addListener)
|
Roo.util.Observable | |
purgeListeners
()
Removes all listeners for this object
Removes all listeners for this object
|
Roo.util.Observable | |
Query the records by a specified property.
Query the records by a specified property.
|
Roo.data.Store | |
Query by a function.
Query by a function. The specified function will be called with each
record in this data source. If the function returns true the record is included in the results.
|
Roo.data.Store | |
rejectChanges
()
Cancel outstanding changes on all changed records.
Cancel outstanding changes on all changed records.
|
Roo.data.Store | |
reload
(Object options)
Reloads the Record cache from the configured Proxy using the configured Reader and
the options from the last load operation performed.
Reloads the Record cache from the configured Proxy using the configured Reader and
the options from the last load operation performed.
|
Roo.data.Store | |
remove
(Ext.data.Record record)
Remove a Record from the Store and fires the remove event.
Remove a Record from the Store and fires the remove event.
|
Roo.data.Store | |
removeAll
()
Remove all Records from the Store and fires the clear event.
Remove all Records from the Store and fires the clear event.
|
Roo.data.Store | |
Roo.util.Observable | ||
Roo.data.Store | ||
Sort the Records.
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. |
Roo.data.Store | |
Sums the value of property for each record between start and end and returns the result.
|
Roo.data.Store | |
Roo.util.Observable |
Event | Defined By | |
---|---|---|
add (Store this, Roo.data.Record[] records, Number index)
Fires when Records have been added to the Store
Fires when Records have been added to the Store
|
Roo.data.Store | |
beforeload (Store this, Object options)
Fires before a request is made for a new data object.
Fires before a request is made for a new data object. If the beforeload handler returns false
the load action will be canceled.
|
Roo.data.Store | |
beforeloadadd (Store this, Roo.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.
|
Roo.data.Store | |
clear (Store this)
Fires when the data cache has been cleared.
Fires when the data cache has been cleared.
|
Roo.data.Store | |
datachanged (Store this)
Fires when the data cache has changed, and a widget which is using this Store
as a Record cache should refresh its view.
Fires when the data cache has changed, and a widget which is using this Store
as a Record cache should refresh its view.
|
Roo.data.Store | |
load (Store this, Roo.data.Record[] records, Object options)
Fires after a new set of Records has been loaded, before they are added to the store.
Fires after a new set of Records has been loaded, before they are added to the store.
|
Roo.data.Store | |
Fires if an exception occurs in the Proxy during loading.
Fires if an exception occurs in the Proxy during loading.
Called with the signature of the Proxy's "loadexception" event. If you return Json { data: [] , success: false, .... } then this will be thrown with the following args |
Roo.data.Store | |
metachange (Store this, Object meta)
Fires when this store's reader provides new metadata (fields).
Fires when this store's reader provides new metadata (fields). This is currently only support for JsonReaders.
|
Roo.data.Store | |
remove (Store this, Roo.data.Record record, Number index)
Fires when a Record has been removed from the Store
Fires when a Record has been removed from the Store
|
Roo.data.Store | |
update (Store this, Roo.data.Record record, String operation)
Fires when a Record has been updated
Fires when a Record has been updated
|
Roo.data.Store |