StorePaging
Configs
5
Configs
5The 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.
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.
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
Properties
6Class hierarchy
Other
If the store is paged, yields the current page number.
Paging
Yields true if this Store is loaded page by page. See the remotePaging config.
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
Functions
3Loads a page of data from the implemented requestData function.
| Parameter | Type | Description |
|---|---|---|
page | Number | The one based page number to load. |
params | Object | A hash of parameters to append to the request event and requestData call |
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.
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.
A promise which is resolved when the request completes and has been processed.
Events
2
Events
2When 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 }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
action | String | (AjaxStore only) The read action being performed: |
url | String | (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. |
params | Object | 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 }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
params | Object | 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
Event handlers
2When the store is paged, this is called before loading a page and is cancelable
new StorePaging({
onBeforeLoadPage({ source, action, url, params }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
action | String | (AjaxStore only) The read action being performed: |
url | String | (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. |
params | Object | 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 }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
params | Object | An object containing property/name pairs which are the parameters. This may be mutated to affect the parameters used in the request. |