StoreLazyLoadPlugin

Plugin for Store that handles lazy loading.

Functions

2

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

ParameterTypeDescription
paramsObject

An optional object with parameters that will be included in the fetch request (only available for AjaxStore configured with a readUrl).

Returns: Promise

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.

ParameterTypeDescription
optionsObject
options.recordsModel | 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.includeDescendantsBoolean

Only available for a TreeStore. If true, all descendant nodes of the provided records will be unloaded. If false, only the provided records will be unloaded.

Events

2

Fired 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 }) => {

});
ParameterTypeDescription
sourceStore

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 }) => {

});
ParameterTypeDescription
sourceStore

This Store

Event handlers

2

Called 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 }) {

    }
});
ParameterTypeDescription
sourceStore

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 }) {

    }
});
ParameterTypeDescription
sourceStore

This Store