DateStoreLazyLoadPlugin
Plugin for Store that handles lazy loading of stores that is dependent on the view's visible time span.
Configs
1
Configs
1If set to true, or a config object, this makes the store load new records when needed. When a record that
is not already loaded is requested, the requestData function is called. Please read the
guide to learn more on how to configure lazy loading.
| Parameter | Type | Description |
|---|---|---|
bufferUnit | DurationUnit | Used together with bufferAmount to calculate the start and end dates of each load request. The value is added to the current visible start or end date. Defaults to the visible time span length. |
bufferAmount | Number | See |
dateFormat | String | The format used to convert |
loadFullResourceRange | Boolean | If the ResourceStore is not lazy loaded, set this to |
useResourceIds | Boolean | Set to |
Properties
3
Properties
3Class hierarchy
Other
If set to true, or a config object, this makes the store load new records when needed. When a record that
is not already loaded is requested, the requestData function is called. Please read the
guide to learn more on how to configure lazy loading.
| Parameter | Type | Description |
|---|---|---|
bufferUnit | DurationUnit | Used together with bufferAmount to calculate the start and end dates of each load request. The value is added to the current visible start or end date. Defaults to the visible time span length. |
bufferAmount | Number | See |
dateFormat | String | The format used to convert |
loadFullResourceRange | Boolean | If the ResourceStore is not lazy loaded, set this to |
useResourceIds | Boolean | Set to |
Functions
3
Functions
3In an EventStore or ResourceTimeRangeStore which is configured with
lazyLoad, the function provided here is called when a combination of the visible
date range and the visible range of resources has not yet been loaded. If the ResourceStore is not configured
with lazyLoad, the resource range will include all the loaded resources. When
implementing this, it is expected that what is returned is an object with a data property containing the
records from startDate to endDate for a range of resources starting at startIndex and with the length
specified in the count param.
Base implementation does nothing, either use AjaxStore which implements it, or create your own subclass with an implementation.
class MyEventStore extends EventStore {
async requestData(params){
const response = await fetch('https://api.bryntum.com/events/?' + new URLSearchParams(params));
return await response.json();
}
}
| Parameter | Type | Description |
|---|---|---|
options | Object | |
options.startDate | Date | The start date of the current timespan |
options.endDate | Date | The end date of the current timespan |
options.startIndex | Number | The resource start index |
options.count | Number | The resource count |
Only available if the store is configured as lazyLoad.
The records matching the provided parameters will be removed from the Store and reloaded the next they are needed.
Provide an array of records or record ids, or provide a combination of resource records (or ids) and/or a date
range. Do not combine the records params with the resources and startDate and endDate params.
| 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.resources | ResourceModel | Number | String | ResourceModel[] | Number[] | String[] | The resources to unload records for. Requires the |
options.startDate | Date | The start date of the range to unload records for. Requires the |
options.endDate | Date | The end date of the range to unload records for. Requires the |