LazyLoadCrudManager

Configs

4
lazyLoad: Boolean | ObjectAlso a property

If set to true, or a config object, this makes the CrudManager load records only when needed. When a record or a date range that is not already loaded is requested, a load request will be made to the specified URL. More more details about lazy loading, see the guide

ParameterTypeDescription
lazyLoadObject

Lazy load config

lazyLoad.chunkSizeNumber

The number of records to be loaded before and after the requested index (only affects the ResourceStore).

bufferUnitDurationUnit

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 (does not affect ResourceStore).

bufferAmountNumber

See bufferUnit

pageSize: Number

The number of Resource records each page should contain, when using remotePaging

remotePaging: Boolean

If set to true, this makes the CrudManager load pages of data, instead of loading the complete dataset at once. The requests made to the loadUrl will contain params with info about the current dataset being requested:

  • page - The resource page
  • pageSize - The resource page size
  • startDate - The start date of the calculated timespan
  • endDate - The end date of the calculated timespan

For more details about paging, see the guide

requestData: function

When the CrudManager/Project is configured with lazyLoad set to true, you can configure your own data fetching logic by implementing this function. Doing this will override the built-in fetching mechanism using the loadUrl.

When implementing this, it is expected that what is returned is an object fulfilling the contract of a regular CrudManager/Project load call.

ParameterTypeDescription
paramsLazyLoadCrudManagerRequestParams

Object containing info of what data is requested

Properties

3

Class hierarchy

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

Lazy Loading

lazyLoad: Boolean | ObjectAlso a config

If set to true, or a config object, this makes the CrudManager load records only when needed. When a record or a date range that is not already loaded is requested, a load request will be made to the specified URL. More more details about lazy loading, see the guide

ParameterTypeDescription
lazyLoadObject

Lazy load config

lazyLoad.chunkSizeNumber

The number of records to be loaded before and after the requested index (only affects the ResourceStore).

bufferUnitDurationUnit

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 (does not affect ResourceStore).

bufferAmountNumber

See bufferUnit

Typedefs

2

An object containing details about the received data used for lazy and paged loading

ParameterTypeDescription
resourcesObject
resources.rowsObject[]
resources.totalNumber
eventsObject
events.rowsObject[]
assignmentsObject
assignments.rowsObject[]
resourceTimeRangesObject
resourceTimeRanges.rowsObject[]
timeRangesObject
timeRanges.rowsObject[]
calendarsObject
calendars.rowsObject[]

An object containing details about the requested data

ParameterTypeDescription
startIndexNumber

The index of the first record being requested

countNumber

The number of records being requested

startDateDate

The startDate of the requested date range (only if applicable)

endDateDate

The endDate of the requested date range (only if applicable)

parentIdString | Number

The parentId for which to load children (only if Resource store is a tree store)

storesString[]

The id's of the stores which the CrudManager requests data for