v7.3.0
SupportExamplesFree Trial

AllocationCellEdit
Feature

Adding this feature to the resource utilization view enables assignment effort data editing.

// <code-header> // This example uses Scheduler Pro TimePhasedProjectModel class // which is named SchedulerProTimePhasedProjectModel in the Gantt distribution TimePhasedProjectModel = typeof SchedulerProTimePhasedProjectModel !== 'undefined' ? SchedulerProTimePhasedProjectModel : TimePhasedProjectModel; targetElement.innerHTML = '<p>Double click an event row effort value to edit it. Use <kbd>F2</kbd> or <kbd>ENTER</kbd> to complete the editing and <kbd>ESC</kbd> to reject changes:</p>'; // </code-header> const resourceUtilization = new ResourceUtilization({ project : new TimePhasedProjectModel({ loadUrl : 'data/SchedulerPro/examples/view/ResourceUtilization.json', autoLoad : true }), columns : [ { type : 'tree', text : 'Name', field : 'name', width : 170, renderer({ record, value }) { return record.generatedParent ? record.key.name : value; } } ], // the view should not be readOnly to allow editing readOnly : false, features : { // Allow effort values editing allocationCellEdit : true, scheduleContext : { // allow navigating the time axis cells w/ keyboard keyNavigation : true }, treeGroup : { // group by resource levels : [ // group by resource ({ origin }) => { // origin could be an array of time-phased assignments origin = origin[0] || origin; return origin.resource; } ] } }, startDate : new Date(2020, 3, 26), endDate : new Date(2020, 4, 15), appendTo : targetElement, rowHeight : 40, tickSize : 40, minHeight : '20em', // display tooltip showBarTip : true });

Start editing

In order to start editing effort, one can double click it or press Enter or F2 key when the corresponding cell is selected, or just start typing a number if autoEdit is enabled (which it is by default).

new ResourceUtilization({
   ...
   features : {
       // allow effort editing
       allocationCellEdit : true,
       ...
   },
   ...
});

Finish editing

Editing can be cancelled by pressing Escape key, which will reject the change. In order to complete the edit and apply the change press F2 key or just click outside the editor.

Keyboard shortcuts

While not editing

Keys Action
Enter Starts editing currently focused cell
F2 Starts editing currently focused cell

While editing

Keys Action
Enter Finish editing and start editing the same cell in next row
Shift+Enter Finish editing and start editing the same cell in previous row
F2 Finish editing
Escape Cancel editing without applying changes
Tab Finish editing and start editing the next cell in the same row
Shift+Tab Finish editing and start editing the previous cell in the same row

This feature is disabled by default.

Useful configs

Config Description
autoEdit Start editing by typing a number
editor Configuration for the embedded editor
forceTickDatesUsage Always use tick start/end dates

See also

No results

Configs

Configs are options you supply in a configuration object when creating an instance of this class
  • Set to true to start editing when user starts typing a number on a focused allocation cell

    Has a corresponding runtime autoEdit property.

  • The embedded editor configuration.

  • Provide true to always use the edited ticks start and end dates. If false (default) the feature will use the edited assignment start date when editing the very first tick of the assignment and respectively the assignment end date when editing the last ticks).

  • Internal listeners, that cannot be removed by the user.

  • The widget which this plugin is to attach to.

    Has a corresponding runtime client property.

  • Set to false to disable localization of this object.

Properties

Properties are getters/setters or publicly accessible variables on this class
  • isAllocationCellEdit : Booleantrue
    READONLY
    static
    ADVANCED
    Identifies an object as an instance of AllocationCellEdit class, or subclass thereof.
  • isEvents : Booleantrue
    READONLY
    static
    ADVANCED
    Events
    Identifies an object as an instance of Events class, or subclass thereof.
  • isLocalizable : Booleantrue
    READONLY
    static
    ADVANCED
    Localizable
    Identifies an object as an instance of Localizable class, or subclass thereof.
  • properties : Object
    internal
    static
    InstancePlugin

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

  • Set to true to start editing when user starts typing a number on a focused allocation cell

    Has a corresponding autoEdit config.

  • emptyArray : Array
    internal
    READONLY
    InstancePlugin

    An empty array that can be used as a default value.

  • emptyObject : Object
    internal
    READONLY
    InstancePlugin

    An empty object that can be used as a default value.

  • isAllocationCellEdit : Booleantrue
    READONLY
    ADVANCED
    Identifies an object as an instance of AllocationCellEdit class, or subclass thereof.
  • isInstancePlugin : Booleantrue
    READONLY
    ADVANCED
    InstancePlugin
    Identifies an object as an instance of InstancePlugin class, or subclass thereof.
  • config : Object
    READONLY
    ADVANCED
    InstancePlugin

    Returns a copy of the full configuration which was used to configure this object.

  • This property is set to true before the constructor returns.

  • isDestroying : Boolean
    READONLY
    ADVANCED
    InstancePlugin

    This property is set to true on entry to the destroy method. It remains on the objects after returning from destroy(). If isDestroyed is true, this property will also be true, so there is no need to test for both (for example, comp.isDestroying || comp.isDestroyed).

  • client : Widget
    READONLY
    ADVANCED
    InstancePlugin

    The Widget which was passed into the constructor, which is the Widget we are providing extra services for.

    Has a corresponding client config.

  • Get the global LocaleHelper

  • Get the global LocaleManager

Functions

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

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

  • initClass( )
    static
    ADVANCED
    InstancePlugin

    Registers this class type with its Factory

  • Internal function used to hook destroy() calls when using thisObj

  • Internal function used restore hooked destroy() calls when using thisObj

  • doDestroy( )
    internal
    Events

    Auto detaches listeners registered from start, if set as detachable

  • once( )
    private
    Events

    Internal function used to run a callback function after an event is triggered

  • Removes all listeners registered to this object by the application.

  • This will merge a feature's (subclass of InstancePlugin) keyMap with it's client's keyMap.

Events

Events are triggered for certain actions in this class and can be listened for to react to those actions in your code

Event handlers

Event handlers are callbacks called as a result of certain actions in this class
id: allocationCellEdit

Source path

SchedulerPro/feature/AllocationCellEdit.js

Contents