StoreLazyLoadPlugin
Plugin for Store that handles lazy loading.
Functions
2
Functions
2Only available if the store is configured as lazyLoad. Calling will initiate a load request for 1 chunk of records starting from index 0. If the store has previously been loaded, it will be cleared of all records and all lazy loading cache.
| Parameter | Type | Description |
|---|---|---|
params | Object | An optional object with parameters that will be included in the fetch request (only available for AjaxStore configured with a readUrl). |
Only available if the store is configured as lazyLoad.
For a flat Store, calling this method will remove the provided records from the store and reload them the next time they are rendered.
For a tree Store, calling this method will remove all child nodes of the provided parent nodes and reload the parent nodes the next time they are rendered or expanded.
| Parameter | Type | Description |
|---|---|---|
options | Object | |
options.records | Model | Number | String | Model[] | Number[] | String[] | The records to unload. Can be a record instance, record id, or an array of record instances or ids. |
options.includeDescendants | Boolean | Only available for a TreeStore. If |
Events
2
Events
2Fired when the store finished loading new chunks (the store stops loading). This event will not be triggered if the store has loading requests pending response.
// Adding a listener using the "on" method
storeLazyLoadPlugin.on('lazyLoadEnded', ({ source }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
Fired when the store starts loading new chunks (the store enters a state of loading). This event will not be triggered if new records are requested when the store already is loading.
// Adding a listener using the "on" method
storeLazyLoadPlugin.on('lazyLoadStarted', ({ source }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
Event handlers
2
Event handlers
2Called when the store finished loading new chunks (the store stops loading). This event will not be called if the store has loading requests pending response.
new StoreLazyLoadPlugin({
onLazyLoadEnded({ source }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
Called when the store starts loading new chunks (the store enters a state of loading). This event will not be called if new records are requested when the store already is loading.
new StoreLazyLoadPlugin({
onLazyLoadStarted({ source }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |