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
- ResourceUtilization — The view this feature plugs into
- AllocationCopyPaste — Copy and paste allocation cell values
- ResourceHistogram — Companion histogram view for resource data
Configs
Configs are options you supply in a configuration object when creating an instance of this class-
Set to
trueto start editing when user starts typing a number on a focused allocation cellHas a corresponding runtime autoEdit property.
-
The embedded editor configuration.
-
Provide
trueto always use the edited ticks start and end dates. Iffalse(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
falseto disable localization of this object.
Properties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of AllocationCellEdit class, or subclass thereof.
-
Identifies an object as an instance of Events class, or subclass thereof.
-
Identifies an object as an instance of Localizable class, or subclass thereof.
-
A class property getter for the default values of internal properties for this class.
-
Set to
trueto start editing when user starts typing a number on a focused allocation cellHas a corresponding autoEdit config.
-
An empty array that can be used as a default value.
-
An empty object that can be used as a default value.
-
Identifies an object as an instance of AllocationCellEdit class, or subclass thereof.
-
Identifies an object as an instance of InstancePlugin class, or subclass thereof.
-
Returns a copy of the full configuration which was used to configure this object.
-
This property is set to
truebefore theconstructorreturns. -
This property is set to
trueon entry to the destroy method. It remains on the objects after returning fromdestroy(). If isDestroyed istrue, this property will also betrue, so there is no need to test for both (for example,comp.isDestroying || comp.isDestroyed). -
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-
This optional class method is called when a class is mixed in using the mixin() method.
-
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
-
Auto detaches listeners registered from start, if set as detachable
-
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.