ProjectModel
This class represents a global project of your TaskBoard - a central place for all data.
It holds and links the stores usually used by TaskBoard:
Loading remote data
const taskBoard = new TaskBoard({
project : {
// Project configuration
}
});
Working with inline data
The project provides an inlineData getter/setter that can be used to manage data from all Project stores at once. Populating the stores this way can be useful if you do not want to use the CrudManager for server communication but instead load data using Axios or similar.
Getting data
const data = taskboard.project.inlineData;
// use the data in your application
Setting data
// Get data from server manually
const data = await axios.get('/project?id=12345');
// Feed it to the project
taskboard.project.inlineData = data;
See also loadInlineData
Getting modifications
const taskBoard = new TaskBoard({
project : {
// Project configuration
}
});
Built-in StateTrackingManager
The project also has a built-in StateTrackingManager (STM for short), that handles undo/redo for the project stores (additional stores can also be added). You can enable it to track all project store changes:
// Turn on auto recording when you create your TaskBoard:
const taskBoard = new TaskBoard({
project : {
stm : {
autoRecord : true
}
}
});
// Undo a transaction
project.stm.undo();
// Redo
project.stm.redo();
Configs
Configs are options you supply in a configuration object when creating an instance of this class-
The constructor of the task model class, to be used in the project. Will be set as the modelClass property of the taskStore.
-
The constructor to create a task store instance with. Should be a class, subclassing the TaskStore.
Properties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of ProjectModel class, or subclass thereof.
-
Identifies an object as an instance of ProjectModel class, or subclass thereof.