StorePaging

Configs

5

The name of the parameter to use when requesting pages of data using the zero based index of the required page's starting record.

When the Store is paged by configuring remotePaging, this value will be included in the load requests.

Note: Setting pageSize at runtime will automatically reload the page.

pageSizeParamName: String= pageSize

The name of the parameter to use when requesting pages of data, representing the configured pageSize value.

The name of the parameter to use when requesting pages of data using the one based page number required.

remotePaging: Boolean

Set this to true to activate remote paging in this Store. Makes it possible to use the loadPage, nextPage, and previousPage functions. Or add the PagingToolbar to control what page to load.

For a non-AjaxStore, data will be requested by the Store by calling a by the app implemented requestData function. Data can also be provided by listening to the requestData event, and updating the data property with new data.

Properties

6

Class hierarchy

isStorePaging: Boolean= truereadonly
Identifies an object as an instance of StorePaging class, or subclass thereof.
isStorePaging: Boolean= truereadonlystatic
Identifies an object as an instance of StorePaging class, or subclass thereof.

Other

currentPage: Numberreadonly

If the store is paged, yields the current page number.

Paging

isPaged: Booleanreadonly

Yields true if this Store is loaded page by page. See the remotePaging config.

lastPage: Numberreadonly

If the store is paged, yields the highest page number in the dataset as calculated from the 'total' returned in the last page data block loaded.

When the Store is paged by configuring remotePaging, this value will be included in the load requests.

Note: Setting pageSize at runtime will automatically reload the page.

Functions

3

Loads a page of data from the implemented requestData function.

ParameterTypeDescription
pageNumber

The one based page number to load.

paramsObject

A hash of parameters to append to the request event and requestData call

Returns: Promise -

A Promise which will be resolved when the request completes

If this store is paged, and is not already at the lastPage then this will load the next page of data.

Returns: Promise -

A promise which is resolved when the request completes and has been processed.

If this store is paged, and is not already at the first page then this will load the previous page of data.

Returns: Promise -

A promise which is resolved when the request completes and has been processed.

Events

2

When the store is paged, this is fired before loading a page and is cancelable

// Adding a listener using the "on" method
storePaging.on('beforeLoadPage', ({ source, action, url, params }) => {

});
ParameterTypeDescription
sourceStore

This Store

actionString

(AjaxStore only) The read action being performed: 'readPage'

urlString

(AjaxStore only) The URL to which the HTTP request will be sent. This property may be mutated in an event handler without changing the base readUrl configured for this Store.

paramsObject

An object containing property/name pairs which are the parameters. This may be mutated to affect the parameters used in the request.

When the store is paged, this is fired when a page is loaded.

// Adding a listener using the "on" method
storePaging.on('loadPage', ({ source, params }) => {

});
ParameterTypeDescription
sourceStore

This Store

paramsObject

An object containing property/name pairs which are the parameters. This may be mutated to affect the parameters used in the request.

Event handlers

2

When the store is paged, this is called before loading a page and is cancelable

new StorePaging({
    onBeforeLoadPage({ source, action, url, params }) {

    }
});
ParameterTypeDescription
sourceStore

This Store

actionString

(AjaxStore only) The read action being performed: 'readPage'

urlString

(AjaxStore only) The URL to which the HTTP request will be sent. This property may be mutated in an event handler without changing the base readUrl configured for this Store.

paramsObject

An object containing property/name pairs which are the parameters. This may be mutated to affect the parameters used in the request.

When the store is paged, this is called when a page is loaded.

new StorePaging({
    onLoadPage({ source, params }) {

    }
});
ParameterTypeDescription
sourceStore

This Store

paramsObject

An object containing property/name pairs which are the parameters. This may be mutated to affect the parameters used in the request.