ResourceStore

A store holding all the resources to be rendered into a Scheduler.

This store only accepts a model class inheriting from ResourceModel.

A ResourceStore is usually connected to a project, which binds it to other related stores (EventStore, AssignmentStore and DependencyStore). The project also handles references (assignments, events) to related records for the records in the store.

Resolving the references happens async, records are not guaranteed to have up to date references until calculations are finished. To be certain that references are resolved, call await project.commitAsync() after store actions. Or use one of the xxAsync functions, such as loadDataAsync().

Using commitAsync():

resourceStore.data = [{ id }, ...];

// references (assignments, events) not resolved yet

await resourceStore.project.commitAsync();

// now they are

Using loadDataAsync():

await resourceStore.loadDataAsync([{ id }, ...]);

// references (assignments, events) are resolved

Configs

80

Common

autoCommitStoreCRUD
autoLoadAjaxStore
dataStore
fieldsStore
groupersStoreGroup
idStore
listenersEvents
sortersStoreSort

Advanced

stmStoreStm
storageStore
useLocaleSortStoreSort

Chained store

chainedFieldsStoreChained
chainedFilterFnStoreChained
chainFiltersStoreChained
dontRelayToMasterStoreChained
doRelayToMasterStoreChained
ignoreLinkRecordsStoreChained
masterStoreStoreChained
syncOrderStoreChained
syncSortStoreChained

CRUD

createUrlAjaxStore
deleteUrlAjaxStore
readUrlAjaxStore
updateUrlAjaxStore

Filtering

filtersStoreFilter
remoteFilterStoreFilter

Misc

Other

lazyLoadAjaxStore
useSparseIndexStoreSparseIndex

Paging

pageParamNameStorePaging
pageSizeStorePaging
remotePagingStorePaging

Records

Remote

fetchOptionsAjaxStore
filterParamNameStoreFilter
headersAjaxStore
httpMethodsAjaxStore
paramsAjaxStore
paramsInBodyAjaxStore
restfulFilterAjaxStore

Sorting

remoteSortStoreSort
sortParamNameStoreSort

Tree

treeStore

Properties

77

Common

idStore

Class hierarchy

isResourceStore: Boolean= truereadonly
Identifies an object as an instance of ResourceStore class, or subclass thereof.
isResourceStore: Boolean= truereadonlystatic
Identifies an object as an instance of ResourceStore class, or subclass thereof.
Identifies an object as an instance of ResourceStoreMixin class, or subclass thereof.
isResourceStoreMixin: Boolean= truereadonlystaticResourceStoreMixin
Identifies an object as an instance of ResourceStoreMixin class, or subclass thereof.
isAjaxStoreAjaxStore
isEventsEvents
isPartOfProjectPartOfProject
isStoreStore
isStoreChainedStoreChained
isStoreChangesStoreChanges
isStoreCRUDStoreCRUD
isStoreFilterStoreFilter
isStoreGroupStoreGroup
isStorePagingStorePaging
isStoreRelationStoreRelation
isStoreSearchStoreSearch
isStoreSortStoreSort
isStoreSparseIndexStoreSparseIndex
isStoreStateStoreState
isStoreStmStoreStm
isStoreSumStoreSum
isStoreSyncStoreSync
isStoreTreeStoreTree

Records

Applies a new dataset to the ResourceStore. Use it to plug externally fetched data into the store.

NOTE: References (events, assignments) on the resources are determined async by a calculation engine. Thus they cannot be directly accessed after assigning the new dataset.

For example:

resourceStore.data = [{ id }];
// resourceStore.first.events is not yet available

To guarantee references are available, wait for calculations for finish:

resourceStore.data = [{ id }];
await resourceStore.project.commitAsync();
// resourceStore.first.events is available

Alternatively use loadDataAsync() instead:

await resourceStore.loadDataAsync([{ id }]);
// resourceStore.first.events is available
autoCommitStoreCRUD
changesStoreCRUD
countStore
firstStore
hasChangesStoreCRUD
lastStore
recordsStore

Advanced

isChainedStoreChained
StopBranchstaticStoreTree

CRUD

createUrlAjaxStore
deleteUrlAjaxStore
isCommittingAjaxStore
isLoadingAjaxStore
readUrlAjaxStore
updateUrlAjaxStore

Filtering

Lifecycle

configBase

Misc

Models & Stores

assignmentStorePartOfProject
dependencyStorePartOfProject
eventStorePartOfProject
projectPartOfProject
resourceStorePartOfProject

Other

currentPageStorePaging
jsonStore
lazyLoadAjaxStore
storesstaticStore

Paging

isPagedStorePaging
lastPageStorePaging
pageSizeStorePaging

Remote

paramsAjaxStore

Sort, group & filter

filtersStoreFilter
groupersStoreGroup
isFilteredStoreFilter
isGroupedStoreGroup
isSortedStoreSort
sortersStoreSort

Tree

isTreeStoreTree
leavesStoreTree

Functions

104

CRUD

Add resources to the store.

NOTE: References (events, assignments) on the resources are determined async by a calculation engine. Thus they cannot be directly accessed after using this function.

For example:

const [resource] = resourceStore.add({ id });
// resource.events is not yet available

To guarantee references are set up, wait for calculations for finish:

const [resource] = resourceStore.add({ id });
await resourceStore.project.commitAsync();
// resource.events is available (assuming EventStore is loaded and so on)

Alternatively use addAsync() instead:

const [resource] = await resourceStore.addAsync({ id });
// resource.events is available (assuming EventStore is loaded and so on)
ParameterTypeDescription
recordsResourceModel | ResourceModel[] | ResourceModelConfig | ResourceModelConfig[]

Array of records/data or a single record/data to add to store

silentBoolean

Specify true to suppress events

Returns: ResourceModel[] -

Added records

Add resources to the store and triggers calculations directly after. Await this function to have up to date references on the added resources.

const [resource] = await resourceStore.addAsync({ id });
// resource.events is available (assuming EventStore is loaded and so on)
ParameterTypeDescription
recordsResourceModel | ResourceModel[] | ResourceModelConfig | ResourceModelConfig[]

Array of records/data or a single record/data to add to store

silentBoolean

Specify true to suppress events

Returns: ResourceModel[] -

Added records

Applies a new dataset to the ResourceStore and triggers calculations directly after. Use it to plug externally fetched data into the store.

await resourceStore.loadDataAsync([{ id }]);
// resourceStore.first.events is available
ParameterTypeDescription
dataResourceModelConfig[]

Array of ResourceModel data objects

applyChangesetStoreChanges
commitAjaxStore
insertStoreCRUD
loadAjaxStore
loadChildrenAjaxStore
loadPageAjaxStore
moveStoreCRUD
nextPageStorePaging
previousPageStorePaging
removeStoreCRUD
removeAllStoreCRUD
revertChangesStoreCRUD

Other

Returns all resources that have no events assigned during the specified time range.

ParameterTypeDescription
startDateDate

Time range start date

endDateDate

Time range end date

Returns: ResourceModel[] -

Resources without events

getStorestaticStore
onEvents
relayAllEvents
toJSONStore
triggerEvents
unEvents

Chained store

chainStoreChained
chainTreeStoreChained
fillFromMasterStoreChained

Configuration

applyDefaultsstaticBase

Events

Iteration

everyStore
flatMapStore
forEachStore
mapStore
reduceStore

Lifecycle

destroystaticBase

Misc

initClassstaticBase
isOfTypeNamestaticBase
mixinstaticBase

Records

getAtStore
getByIdStore
indexOfStore

Search

findStoreSearch
findByFieldStoreSearch
findRecordStoreSearch
queryStoreSearch
searchStoreSearch
someStoreSearch

Sort, group & filter

addFilterStoreFilter
addSorterStoreSort
clearFiltersStoreFilter
clearGroupersStoreGroup
clearSortersStoreSort
filterStoreFilter
filterByStoreFilter
getGroupRecordsStoreGroup
getGroupTitlesStoreGroup
groupStoreGroup
isRecordInGroupStoreGroup
removeFilterStoreFilter
removeSorterStoreSort
setGroupersStoreGroup
sortStoreSort

Sum

averageStoreSum
groupSumStoreSum
maxStoreSum
minStoreSum
sumStoreSum

Traverse

getNextStore
getPrevStore

Tree

getChildrenStoreTree
indentStoreTree
outdentStoreTree

Values

Events

45
addStoreCRUD
beforeAddStoreCRUD
beforeCommitStoreCRUD
beforeFilterStoreFilter
beforeIndentStoreTree
beforeLoadAjaxStore
beforeLoadPageStorePaging
beforeOutdentStoreTree
beforeRemoveStoreCRUD
beforeSortStoreSort
catchAllEvents
changeStore
commitStoreCRUD
commitAddedAjaxStore
commitRemovedAjaxStore
destroyEvents
exceptionAjaxStore
filterStoreFilter
groupStoreGroup
indentStoreTree
loadAjaxStore
loadChildrenAjaxStore
loadPageStorePaging
loadPageStartAjaxStore
loadStartAjaxStore
moveStore
outdentStoreTree
refreshStore
removeStoreCRUD
removeAllStoreCRUD
sortStoreSort
updateStore

Event handlers

45
onAddStoreCRUD
onBeforeAddStoreCRUD
onBeforeFilterStoreFilter
onBeforeLoadAjaxStore
onBeforeLoadPageStorePaging
onBeforeSortStoreSort
onCommitStoreCRUD
onCommitAddedAjaxStore
onDestroyEvents
onExceptionAjaxStore
onFilterStoreFilter
onGroupStoreGroup
onIndentStoreTree
onLoadAjaxStore
onLoadPageStorePaging
onLoadStartAjaxStore
onMoveStore
onOutdentStoreTree
onRemoveStoreCRUD
onRemoveAllStoreCRUD
onSortStoreSort

Typedefs

9