v7.3.0
SupportExamplesFree Trial

TimePhasedTaskModel

The class extends default TaskModel with time-phased assignments support.

No results

Fields

Fields belong to a Model class and define the Model data structure
  • A set of resources assigned to this task

  • The calculated effective scheduling direction of this event. See the direction field for details.

  • Unique identifier of task (mandatory)

  • Name of the task

  • A freetext note about the task.

  • Set this to true to roll up a task to its closest parent

  • Set this to true if this task should be shown in the Timeline widget

  • Specify false to prevent the event from being dragged (if TaskDrag feature is used)

  • Specify false to prevent the task from being resized (if TaskResize feature is used). You can also specify 'start' or 'end' to only allow resizing in one direction

  • The calendar, assigned to the task. Allows you to set the time when task can be performed.

  • Field defining the constraint boundary date or null if constraintType is null.

  • constraintType : 'finishnoearlierthan'/'finishnolaterthan'/'mustfinishon'/'muststarton'/'startnoearlierthan'+ 2 more
    TaskModel

    Field storing the task constraint alias or null if not constraint set. Valid values are:

    • "finishnoearlierthan"
    • "finishnolaterthan"
    • "mustfinishon"
    • "muststarton"
    • "startnoearlierthan"
    • "startnolaterthan"
  • The total projected cost for the event.

  • critical : Boolean
    CALCULATED
    READONLY
    TaskModel

    A calculated field indicating if the task is critical. A task considered critical if its delaying causes the project delay. The field value is calculated based on totalSlack field value.

    if (task.critical) {
        Toast.show(`The ${task.name} is critical!`);
    }
    
  • The effective calendar used by the task. Returns the task own calendar if provided or the project calendar.

  • This boolean flag defines what part of task data should be updated in the FixedUnits scheduling mode. If it is true, then effort is kept intact, and duration is updated. If it is false - vice-versa.

  • Calculated field which encapsulates the duration's magnitude and unit. This field will not be persisted, setting it will update the duration and durationUnit fields.

  • When set to true the task becomes inactive and stops taking part in the project scheduling (doesn't affect linked tasks, rolls up its attributes and affect its assigned resources allocation).

  • When set to true, the startDate of the task will not be changed by any of its incoming dependencies or constraints.

  • The current status of a task, expressed as the percentage completed (integer from 0 to 100)

  • Segments of the task that appear when the task gets splitToSegments.

  • A calculated field storing unit for the totalSlack value.

  • CSS class specifying an icon to apply to the task row

  • A CSS style string (applied to style.cssText) or object (applied to style)

    record.style = 'color: red;font-weight: 800';
    
  • CSS class specifying an icon to apply to the task bar

  • Start expanded or not (only valid for tree data)

  • This is a read-only field provided in server synchronization packets to specify which position the node takes in the parent's ordered children array. This index is set on load and gets updated on reordering nodes in tree. Sorting and filtering have no effect on it.

  • parentId : String/Number/null
    READONLY
    TreeNode

    This is a read-only field provided in server synchronization packets to specify which record id is the parent of the record.

  • This is a read-only field provided in server synchronization packets to specify which position the node takes in the parent's children array. This index is set on load and gets updated automatically after row reordering, sorting, etc. To save the order, need to persist the field on the server and when data is fetched to be loaded, need to sort by this field.

  • Deprecated:

    This field has been deprecated. Please read the guide to find out if your app needs to use the new isFullyLoaded field.

    This field is added to the class at runtime when the Store is configured with lazyLoad. The number specified should reflect the total amount of children of a parent node, including nested descendants.

Configs

Configs are options you supply in a configuration object when creating an instance of this class

Properties

Properties are getters/setters or publicly accessible variables on this class
  • isModelStm : Booleantrue
    READONLY
    static
    ADVANCED
    ModelStm
    Identifies an object as an instance of ModelStm class, or subclass thereof.
  • isPartOfProject : Booleantrue
    READONLY
    static
    ADVANCED
    PartOfProject
    Identifies an object as an instance of PartOfProject class, or subclass thereof.
  • isPercentDoneMixin : Booleantrue
    READONLY
    static
    ADVANCED
    PercentDoneMixin
    Identifies an object as an instance of PercentDoneMixin class, or subclass thereof.
  • isTimePhasedTaskModel : Booleantrue
    READONLY
    static
    ADVANCED
    Identifies an object as an instance of TimePhasedTaskModel class, or subclass thereof.
  • isTimeZonedDatesMixin : Booleantrue
    READONLY
    static
    ADVANCED
    TimeZonedDatesMixin
    Identifies an object as an instance of TimeZonedDatesMixin class, or subclass thereof.
  • isTreeNode : Booleantrue
    READONLY
    static
    ADVANCED
    TreeNode
    Identifies an object as an instance of TreeNode class, or subclass thereof.
  • properties : Object
    internal
    static
    TaskModel

    A class property getter for the default values of internal properties for this class.

  • allFields : DataField[]
    READONLY
    static
    TaskModel

    An array containing all the defined fields for this Model class. This will include all superclass's defined fields.

  • fieldMap : Object<String, DataField>
    READONLY
    static
    TaskModel

    An object containing all the defined fields for this Model class. This will include all superclass's defined fields through its prototype chain. So be aware that Object.keys and Object.entries will only access this class's defined fields.

  • The data source for the id field which provides the ID of instances of this Model.

Functions

Functions are methods available for calling on the class
  • onClassMixedIn( )
    internal
    static
    TaskModel

    This optional class method is called when a class is mixed in using the mixin() method.

  • initClass( )
    static
    ADVANCED
    TaskModel

    Registers this class type with its Factory

  • exposeRelations( )
    internal
    static
    TaskModel

    Makes getters and setters for related records. Populates a Model#relation array with the relations, to allow it to be modified later when assigning stores.

  • Cancels current batch operation. Any changes during the batch are discarded.

  • Reverts changes in this back to their original values.

  • Called from insertChild to notify StateTrackingManager about children insertion. Provides it with all necessary context information collected in beforeInsertChild required to undo/redo the action.

  • Called from removeChild to notify StateTrackingManager about children removing. Provides it with all necessary context information collected in beforeRemoveChild required to undo/redo the action.

  • Called during creation to also turn any children into Models joined to the same stores as this model

  • Initializes model relations. Called from store when adding a record.

  • commitAsync( )
    ASYNC
    PROPAGATING
    TaskModel

    Propagates changes to the dependent tasks. For example:

    // double a task duration
    task.duration *= 2;
    // call commitAsync() to do further recalculations caused by the duration change
    task.commitAsync().then(() => console.log('Schedule updated'));
    
  • convertToMilestone( )
    ASYNC
    PROPAGATING
    TaskModel

    Converts this task to a milestone (start date will match the end date).

  • convertToRegular( )
    ASYNC
    PROPAGATING
    TaskModel

    Converts the milestone task to a regular task with a duration of 1 (keeping current durationUnit).

  • clear( )
    private
    TreeNode

    Removes all records from the rootNode

Source path

Gantt/model/TimePhasedTaskModel.js

Contents