TaskStore

A class representing the tree of tasks in the Gantt project. An individual task is represented as an instance of the TaskModel class. The store expects the data loaded to be hierarchical. Each parent node should contain its children in a property called 'children'.

const taskStore = new TaskStore({
    data : [
        {
            "id"           : 1000,
            "name"         : "Cool project",
            "percentDone"  : 50,
            "startDate"    : "2019-01-02",
            "expanded"     : true,
            "children"     : [
                {
                    "id"           : 1,
                    "name"         : "A leaf node",
                    "startDate"    : "2019-01-02",
                    "percentDone"  : 50,
                    "duration"     : 10,
                }
            ]
        }
    ]
});

Configs

86

Common

autoCommitStoreCRUD
autoLoadAjaxStore
dataStore
fieldsStore
groupersStoreGroup
idStore
listenersEvents
sortersStoreSort

Other

forceWbsOrderForChanges: Boolean= false

Always return changes in increasing WBS order.

outdentIgnoringSiblings: Boolean= false

Controls behavior of the outdent logic regarding siblings. By default, outdent will move child to be its parent's sibling and will move all previous siblings to the outdented node's children. Visually, node will remain in place just changing the level. When set to true only node with its subtree will be outdented, siblings will not change parent. Visually, node will be moved as last child of the new parent.

useOrderedTreeForWbs: Boolean= false

Specifies which tree to use to calculate WBS. Ordered tree is unsortable and unfilterable, it always holds complete tree hierarchy. By default, it uses sortable and filterable tree.

Whether to validate the loaded tasks data by checking if it is suitable for pre-rendering. Pre-rendering is activated with the delayCalculation config option, and it allows to improve the perceived loading performance - the tasks are rendered immediately on load, before the initial calculation completes.

For that to be possible, tasks need to have both start date and end date defined in the incoming data package. If task is not supposed to be rendered (so called "unscheduled" task), it should have the unscheduled field set to true.

Validation process will only be activated for the first data load and only if more than 1k tasks are loaded. Validation will check the initial 100 tasks in the dataset and if less than 10 of them don't have enough data for pre-rendering, validation will pass. Otherwise, validation will issue a console.warn() call with the text, suggesting to include pre-rendering data in the initial dataset.

wbsMode: String | WbsMode

Set to 'auto' to automatically update wbsValue as records in the store are manipulated (e.g., when the user performs drag-and-drop reordering).

In manual mode, the WBS value is initialized as the store loads and only altered implicitly by the indent and outdent methods. The WBS values are otherwise updated only by an explicit call to refreshWbs.

This can also be a WbsMode object that indicates what operations should automatically refresh WBS values.

The operations that trigger WBS refresh can be enabled explicitly in this object, for example:

 wbsMode : {
     add : true,
     remove : true
 }

The above is an opt-in list that enable auto WBS refresh for node add and remove operations (these two operations are associated with dragging to reorder items). No other operation will trigger WBS refresh. At present, this leaves out only the sort operation, but if new auto-refreshing operations were added in future releases, those would also not be included.

Alternatively, this object can be an opt-out specification if all values are falsy:

 wbsMode : {
     sort : false
 }

The above two examples are (currently) equivalent in outcome. The choice between opt-in or opt-out form is a matter of convenience as well as future-proofing preference.

The value 'auto' is equivalent to all properties being true. The value 'manual' (the default) is equivalent to all properties being false.

lazyLoadAjaxStore
useSparseIndexStoreSparseIndex

Advanced

stmStoreStm
storageStore
useLocaleSortStoreSort

Chained store

chainedFieldsStoreChained
chainedFilterFnStoreChained
chainFiltersStoreChained
dontRelayToMasterStoreChained
doRelayToMasterStoreChained
ignoreLinkRecordsStoreChained
masterStoreStoreChained
syncOrderStoreChained
syncSortStoreChained

CRUD

createUrlAjaxStore
deleteUrlAjaxStore
readUrlAjaxStore
updateUrlAjaxStore

Filtering

filtersStoreFilter
remoteFilterStoreFilter

Misc

Models & Stores

taskStorePartOfProject

Paging

pageParamNameStorePaging
pageSizeStorePaging
remotePagingStorePaging

Records

Remote

fetchOptionsAjaxStore
filterParamNameStoreFilter
headersAjaxStore
httpMethodsAjaxStore
paramsAjaxStore
paramsInBodyAjaxStore
restfulFilterAjaxStore

Sorting

remoteSortStoreSort
sortParamNameStoreSort

Tree

treeStore

Properties

79

Common

idStore

Class hierarchy

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

Other

Whether to validate the loaded tasks data by checking if it is suitable for pre-rendering. Pre-rendering is activated with the delayCalculation config option, and it allows to improve the perceived loading performance - the tasks are rendered immediately on load, before the initial calculation completes.

For that to be possible, tasks need to have both start date and end date defined in the incoming data package. If task is not supposed to be rendered (so called "unscheduled" task), it should have the unscheduled field set to true.

Validation process will only be activated for the first data load and only if more than 1k tasks are loaded. Validation will check the initial 100 tasks in the dataset and if less than 10 of them don't have enough data for pre-rendering, validation will pass. Otherwise, validation will issue a console.warn() call with the text, suggesting to include pre-rendering data in the initial dataset.

currentPageStorePaging
jsonStore
lazyLoadAjaxStore
projectPartOfProject
storesstaticStore

Advanced

isChainedStoreChained
StopBranchstaticStoreTree

CRUD

createUrlAjaxStore
deleteUrlAjaxStore
isCommittingAjaxStore
isLoadingAjaxStore
readUrlAjaxStore
updateUrlAjaxStore

Filtering

Lifecycle

configBase

Misc

Models & Stores

assignmentStorePartOfProject
dependencyStorePartOfProject
eventStorePartOfProject
resourceStorePartOfProject
taskStorePartOfProject

Paging

isPagedStorePaging
lastPageStorePaging
pageSizeStorePaging

Records

autoCommitStoreCRUD
changesStoreCRUD
countStore
dataStore
firstStore
hasChangesStoreCRUD
lastStore
recordsStore

Remote

paramsAjaxStore

Sort, group & filter

filtersStoreFilter
groupersStoreGroup
isFilteredStoreFilter
isGroupedStoreGroup
isSortedStoreSort
sortersStoreSort

Tree

isTreeStoreTree
leavesStoreTree

Functions

105

Other

Increase the indentation level of one or more tasks in the tree

ParameterTypeDescription
recordsTaskModel | TaskModel[]

The records to indent.

Returns: Promise -

A promise which yields the result of the operation

Decrease the indentation level of one or more tasks in the tree

ParameterTypeDescription
recordsTaskModel | TaskModel[]

The records to outdent.

Returns: Promise -

A promise which yields the result of the operation

For each task in this TaskStore, sets the data in the passed baseline index to the current state of the task.

ParameterTypeDescription
indexNumber

The index in the baselines list of the baseline to update.

getStorestaticStore
onEvents
relayAllEvents
toJSONStore
triggerEvents
unEvents

Resource

Checks if a date range is allocated or not for a given resource. Will return true if a Resource has its allowOverlap value set to true.

ParameterTypeDescription
startDateDate

The start date

endDateDate

The end date

excludeEventTaskModel | TaskModel[] | null

One or several tasks to exclude from the check (or null)

resourceRecordResourceModel

The resource record

Returns: Boolean -

True if the timespan is available for the resource

Chained store

chainStoreChained
chainTreeStoreChained
fillFromMasterStoreChained

Configuration

applyDefaultsstaticBase

CRUD

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

Events

getEventsGetEventsMixin

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

Values

Events

46

Fired before tasks in the tree are indented. Return false from a listener to prevent the indent.

// Adding a listener using the "on" method
taskStore.on('beforeIndent', ({ source, records }) => {

});
ParameterTypeDescription
sourceTaskStore

The task store

recordsTaskModel[]

Tasks to be indented

Fired before tasks in the tree are outdented. Return false from a listener to prevent the outdent.

// Adding a listener using the "on" method
taskStore.on('beforeOutdent', ({ source, records }) => {

});
ParameterTypeDescription
sourceTaskStore

The task store

recordsTaskModel[]

Tasks to be outdented

Fired after tasks in the tree are indented

// Adding a listener using the "on" method
taskStore.on('indent', ({ source, records }) => {

});
ParameterTypeDescription
sourceTaskStore

The task store

recordsTaskModel[]

Tasks that were indented

Fired after tasks in the tree are outdented

// Adding a listener using the "on" method
taskStore.on('outdent', ({ source, records }) => {

});
ParameterTypeDescription
sourceTaskStore

The task store

recordsTaskModel[]

Tasks that were outdented

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

Event handlers

46

Called before tasks in the tree are indented. Return false from a listener to prevent the indent.

new TaskStore({
    onBeforeIndent({ source, records }) {

    }
});
ParameterTypeDescription
sourceTaskStore

The task store

recordsTaskModel[]

Tasks to be indented

Called before tasks in the tree are outdented. Return false from a listener to prevent the outdent.

new TaskStore({
    onBeforeOutdent({ source, records }) {

    }
});
ParameterTypeDescription
sourceTaskStore

The task store

recordsTaskModel[]

Tasks to be outdented

Called after tasks in the tree are indented

new TaskStore({
    onIndent({ source, records }) {

    }
});
ParameterTypeDescription
sourceTaskStore

The task store

recordsTaskModel[]

Tasks that were indented

Called after tasks in the tree are outdented

new TaskStore({
    onOutdent({ source, records }) {

    }
});
ParameterTypeDescription
sourceTaskStore

The task store

recordsTaskModel[]

Tasks that were outdented

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

Typedefs

10

An object that describes the actions that should trigger a refreshWbs to update WBS values. Objects of this type are passed to wbsMode when the simpler values of 'auto' or (the default) 'manual' are not desired.

The value 'auto' is equivalent to all properties of this object being true. The value 'manual' is equivalent to all properties of this object being false.

ParameterTypeDescription
addBoolean

Set this property to true to refresh WBS values when nodes are added.

removeBoolean

Set this property to true to refresh WBS values when nodes are removed.

sortBoolean

Set this property to true to refresh WBS values when nodes are sorted.

GrouperStoreGroup
HttpMethodsAjaxStore
SorterStoreSort