v7.3.0
SupportExamplesFree Trial

CellEdit
Feature

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

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.

No results

Configs

Configs are options you supply in a configuration object when creating an instance of this class
  • Set to true to select the field text when editing starts

  • blurAction : 'complete'/'cancel'complete
    CellEdit

    What action should be taken when focus moves leaves the cell editor, for example when clicking outside. May be 'complete' or 'cancel'.

  • Set to false to not start editing next record when user presses enter inside a cell editor (or previous record if SHIFT key is pressed). This is set to false when autoEdit is true. Please note that these key combinations could be different if a customized keyMap is used.

  • Class to use as an editor. Default value: Editor

  • See Keyboard shortcuts for details

  • scrollAction : 'complete'/'cancel'/null
    CellEdit

    What action should be taken when the editor is scrolled out of view, for example when using a mousewheel to scroll the grid. May be 'complete' or 'cancel' or null.

    Has a corresponding runtime scrollAction property.

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

  • Set to true to start editing when user starts typing text on a focused cell (as in Excel)

    Has a corresponding runtime autoEdit property.

  • ignoreCSSSelector : Stringbutton,.b-icon,.fa,svg,input,.b-widget
    GridEditBase

    A CSS selector for elements that when clicked, should not trigger editing. Useful if you render actionable icons or buttons into a grid cell.

  • 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
  • isCellEdit : Booleantrue
    READONLY
    static
    ADVANCED
    Identifies an object as an instance of CellEdit class, or subclass thereof.
  • isDelayable : Booleantrue
    READONLY
    static
    ADVANCED
    Delayable
    Identifies an object as an instance of Delayable 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.

  • 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.

  • scrollAction : 'complete'/'cancel'/null
    CellEdit

    What action should be taken when the editor is scrolled out of view, for example when using a mousewheel to scroll the grid. May be 'complete' or 'cancel' or null.

    Has a corresponding scrollAction config.

  • isCellEdit : Booleantrue
    READONLY
    ADVANCED
    Identifies an object as an instance of CellEdit class, or subclass thereof.
  • isGridEditBase : Booleantrue
    READONLY
    ADVANCED
    GridEditBase
    Identifies an object as an instance of GridEditBase class, or subclass thereof.
  • isInstancePlugin : Booleantrue
    READONLY
    ADVANCED
    InstancePlugin
    Identifies an object as an instance of InstancePlugin class, or subclass thereof.
  • Returns the record currently being edited, or null

  • Set to true to start editing when user starts typing text on a focused cell (as in Excel)

    Has a corresponding autoEdit config.

  • Is editing currently active?

  • 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

  • onEditorFocusOut( )
    private
    ASYNC
    CellEdit

    Cancel editing on widget focusout

  • onTapOut( )
    private
    ASYNC
    CellEdit

    Cancel edit on touch outside of grid for mobile Safari (focusout not triggering unless you touch something focusable)

  • 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.

  • onCellClick( )
    private
    ASYNC
    GridEditBase

    Starts editing if user taps selected cell again on touch device. Chained function called when user clicks a cell.

  • Event handler added when editing is active called when user clicks a cell in the grid during editing. It finishes editing and moves editor to the selected cell instead.

  • onElementClick( )
    private
    ASYNC
    CellEdit

    Finish editing if clicking below rows (only applies when grid is higher than rows). Also finish if event target is the subgrid which can happen if the pointer is moved during mouse down.

  • Realign editor if grid renders rows while editing is ongoing (as a result to autoCommit or WebSocket data received).

  • Update the input field if underlying data changes during edit.

  • Called when the user triggers the edit action in triggerEvent config. Starts editing.

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: cellEdit

Source path

Gantt/feature/CellEdit.js

Contents