ProjectConsumer

Configs

2
destroyStores: Boolean

Configure as true to destroy the Project and stores when this is destroyed.

A ProjectModel instance or a config object. The project holds all Scheduler data. Can be omitted in favor of individual store configs or crudManager config.

Note: In SchedulerPro the project is instance of SchedulerPro.model.ProjectModel class.

Properties

4

Class hierarchy

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

Data

A ProjectModel instance or a config object. The project holds all Scheduler data. Can be omitted in favor of individual store configs or crudManager config.

Note: In SchedulerPro the project is instance of SchedulerPro.model.ProjectModel class.

Misc

isEngineReady: Boolean

Returns true if engine is in a stable calculated state, false otherwise.

Functions

2

Implement in subclass to take action when project is replaced.

super.updateProject(...arguments) must be called first.

ParameterTypeDescription
projectProjectModel

Accepts a callback that will be called when the underlying project is ready (no commit pending and current commit finalized)

ParameterTypeDescription
callbackfunction

Events

1

Fired when data in any of the projects stores changes.

Basically a relayed version of each store's own change event, decorated with which store it originates from. See the store change event documentation for more information.

// Adding a listener using the "on" method
projectConsumer.on('dataChange', ({ source, project, store, action, record, records, changes }) => {

});
ParameterTypeDescription
sourceProjectConsumer

Owning component

projectProjectModelMixin

Project model

storeStore

Affected store

actionremove | removeAll | add | clearchanges | filter | update | dataset | replace

Name of action which triggered the change. May be one of:

  • 'remove'
  • 'removeAll'
  • 'add'
  • 'clearchanges'
  • 'filter'
  • 'update'
  • 'dataset'
  • 'replace'
recordModel

Changed record, for actions that affects exactly one record ('update')

recordsModel[]

Changed records, passed for all actions except 'removeAll'

changesObject

Passed for the 'update' action, info on which record fields changed

Event handlers

1

Called when data in any of the projects stores changes.

Basically a relayed version of each store's own change event, decorated with which store it originates from. See the store change event documentation for more information.

new ProjectConsumer({
    onDataChange({ source, project, store, action, record, records, changes }) {

    }
});
ParameterTypeDescription
sourceProjectConsumer

Owning component

projectProjectModelMixin

Project model

storeStore

Affected store

actionremove | removeAll | add | clearchanges | filter | update | dataset | replace

Name of action which triggered the change. May be one of:

  • 'remove'
  • 'removeAll'
  • 'add'
  • 'clearchanges'
  • 'filter'
  • 'update'
  • 'dataset'
  • 'replace'
recordModel

Changed record, for actions that affects exactly one record ('update')

recordsModel[]

Changed records, passed for all actions except 'removeAll'

changesObject

Passed for the 'update' action, info on which record fields changed