CellEdit

Extends the CellEdit to encapsulate Gantt functionality. This feature is enabled by default

Cell edit
//<code-header>
fiddle.title = 'Cell edit';
//</code-header>
targetElement.innerHTML = '<p>Double-click <b>Name</b> column cells or click the <b>Edit</b> button to start editing:</p>';

// Project contains all the data and is responsible for correct scheduling
const project = new ProjectModel({
    startDate : new Date(2017, 0, 1),

    tasks : [
        {
            id       : 1,
            name     : 'Write docs',
            expanded : true,
            children : [
                { id : 2, name : 'Proof-read docs', startDate : '2017-01-02', endDate : '2017-01-05' },
                { id : 3, name : 'Release docs', startDate : '2017-01-09', endDate : '2017-01-10' }
            ]
        }
    ],

    dependencies : [
        { fromTask : 2, toTask : 3 }
    ]
});

const gantt = new Gantt({
    appendTo : targetElement,

    layoutStyle : {
        alignItems   : 'stretch',
        alignContent : 'stretch'
    },

    tbar : [{
        type    : 'button',
        text    : 'Edit',
        onClick : ({ source }) => {
            gantt.startEditing({
                field  : 'name',
                record : gantt.selectedRecords.length && gantt.selectedRecords[0] || gantt.taskStore.first
            });
        }
    }],

    ref       : 'gantt', // reference is used to easily obtain Gantt reference in it's parent container (see Edit button click handler)
    flex      : '1 0 100%',
    project, // Gantt needs project to get schedule data from
    startDate : new Date(2016, 11, 31),
    endDate   : new Date(2017, 0, 11),
    height    : 300,
    columns   : [
        { type : 'name', field : 'name', text : 'Name' }
    ]
});

Editing can be started by a user by double-clicking an editable cell in the gantt's data grid, or it can be started programmatically by calling startEditing and providing it with correct cell context.

See doAddNewAtEnd.

Instant update

If instantUpdate on the column is set to true, record will be updated instantly as value in the editor is changed. In combination with autoSync it could result in excessive requests to the backend.

Instant update is enabled for these columns by default:

To disable instant update on the column set config to false:

new Gantt({
    columns: [
        {
            type: 'startdate',
            instantUpdate: false
        }
    ]
})

This feature is enabled by default.

Configs

22

Common

disabledInstancePlugin
listenersEvents

Misc

clientInstancePlugin
localeClassLocalizable
localizableLocalizable

Other

addNewAtEndCellEdit
autoEditGridEditBase
autoSelectCellEdit
blurActionCellEdit
ignoreCSSSelectorGridEditBase
keyMapCellEdit
multiEditCellEdit
scrollActionCellEdit
triggerEventGridEditBase

Properties

23

Common

disabledInstancePlugin

Class hierarchy

isCellEdit: Boolean= truereadonly
Identifies an object as an instance of CellEdit class, or subclass thereof.
isCellEdit: Boolean= truereadonlystatic
Identifies an object as an instance of CellEdit class, or subclass thereof.
isDelayableDelayable
isEventsEvents
isGridEditBaseGridEditBase
isInstancePluginInstancePlugin
isLocalizableLocalizable

Lifecycle

configBase

Misc

clientInstancePlugin
localeHelperLocalizable
localeManagerLocalizable

Other

activeRecordGridEditBase
autoEditGridEditBase
isEditingGridEditBase
scrollActionCellEdit

Functions

34

Other

Adds a new, empty record at the end of the TaskStore with the initial data specified by the addNewAtEnd setting.

Returns: Promise -

Newly added record wrapped in a promise.

confirmCellEdit
createOnFrameDelayable
LstaticLocalizable
onEvents
relayAllEvents
triggerEvents
unEvents

Configuration

applyDefaultsstaticBase

Editing

startEditingCellEdit

Events

Lifecycle

destroystaticBase

Misc

doDisableInstancePlugin
initClassstaticBase
isOfTypeNamestaticBase
mixinstaticBase
optionalLstaticLocalizable

Events

13

Event handlers

13

Typedefs

3