AddNewColumn

This column allows user to dynamically add columns to the Gantt chart by clicking the column header and picking columns from a combobox.

Customizing the combobox store data

In order to add, update or remove a column from the combobox one can use processComboStoreConfig config:

new Gantt{{
    columns : [
        {
            type : 'addnew',
            processComboStoreConfig({ config, column }) {
                // Add a new custom column to the combobox
                config.data.push({
                    text  : 'Custom date',
                    // column config
                    value : {
                        type  : 'date',
                        field : 'customDate',
                        text  : 'Custom date'
                    }
                });
            }
        }
    ]
}}

Adding a custom column class

In order to appear in the column combobox list a column class have to fulfill these conditions:

  1. the class should have a static property type with unique string value that will identify the column.
  2. the class should be registered with the call to ColumnStore.registerColumnType.
  3. the class should have a static property isGanttColumn with truthy value.
  4. the class should have a static text property with column name.

For example:

import ColumnStore from 'gantt-distr/lib/Grid/data/ColumnStore.js';
import Column from 'gantt-distr/lib/Grid/column/Column.js';

// New column class to display task priority
export default class TaskPriorityColumn extends Column {
    // unique alias of the column
    static type = 'priority';

    // indicates that the column should be present in "Add New..." column
    static isGanttColumn = true;

    static defaults = {
        // the column is mapped to "priority" field of the Task model
        field : 'priority',
        // the column title
        text  : 'Priority'
    };
}

// register new column
ColumnStore.registerColumnType(TaskPriorityColumn);

Configs

83

Common

Specify true to allow adding more than one column of the same type to the Gantt.

A configuration object to apply to the {Core.widget.Combo} rendered into the column header.

A function to be called for processing the column combo store configuration object. Can be specified as a function, or name of a function in the ownership.

Can be used for editing the combo store data. For example:

new Gantt({
    columns : [
        {
            type : 'addnew',
            processComboStoreConfig({ config, column }) {
                // Adding a custom column
                config.data.push({
                    text  : 'Custom date',
                    // column config
                    value : {
                        type  : 'date',
                        field : 'customDate',
                        text  : 'Custom date'
                    }
                });
            }
        }
    ]
});
ParameterTypeDescription
dataObject

Wrapping object

data.configStoreConfig

The combo store configuration.

data.config.dataAddNewColumnComboModelConfig[]

The store data.

data.columnAddNewColumn

The column.

Returns: void
autoWidthColumn
fieldColumn
fitModeColumn
flexColumn
listenersEvents
maxWidthColumn
textColumn
widthColumn

Accessibility

ariaLabelColumn

Export

Integration

vueColumn

Interaction

collapsedColumn
draggableColumn
editorColumn
groupableColumn
hideableColumn
resizableColumn
sealedColumn
sortableColumn

Layout

alignColumn
hiddenColumn
lockedColumn
minWidthColumn
regionColumn

Menu

Merge cells

mergeableColumn

Misc

localeClassLocalizable
localizableLocalizable
tagsColumn
treeColumn

Other

formulaColumn
pinnedColumn
readOnlyColumn

Rendering

cellClsColumn
clsColumn
iconColumn
rendererColumn
tooltipColumn

Summary

sumColumn
summariesColumn

Properties

154

Common

Specify true to allow adding more than one column of the same type to the Gantt.

A configuration object to apply to the {Core.widget.Combo} rendered into the column header.

A function to be called for processing the column combo store configuration object. Can be specified as a function, or name of a function in the ownership.

Can be used for editing the combo store data. For example:

new Gantt({
    columns : [
        {
            type : 'addnew',
            processComboStoreConfig({ config, column }) {
                // Adding a custom column
                config.data.push({
                    text  : 'Custom date',
                    // column config
                    value : {
                        type  : 'date',
                        field : 'customDate',
                        text  : 'Custom date'
                    }
                });
            }
        }
    ]
});
ParameterTypeDescription
dataObject

Wrapping object

data.configStoreConfig

The combo store configuration.

data.config.dataAddNewColumnComboModelConfig[]

The store data.

data.columnAddNewColumn

The column.

Returns: void
autoWidthColumn
fieldColumn
fitModeColumn
flexColumn
maxWidthColumn
textColumn
widthColumn

Class hierarchy

isAddNewColumn: Boolean= truereadonly
Identifies an object as an instance of AddNewColumn class, or subclass thereof.
isAddNewColumn: Boolean= truereadonlystatic
Identifies an object as an instance of AddNewColumn class, or subclass thereof.
isColumnColumn
isEventsEvents
isLocalizableLocalizable
isModelModel
isModelLinkModelLink
isModelStmModelStm
isTreeNodeTreeNode

Other

Returns the combo box field rendered into the header of this column

$namestaticModel
defaultsColumn
elementColumn
formulaColumn
gridColumn
pinnedColumn
readOnlyColumn
relationsstaticModel
subGridColumn
typestaticColumn
visibleColumn

Accessibility

ariaLabelColumn

Editing

copyOfModel
isValidModel

Export

Fields

allFieldsstaticModel
autoExposeFieldsstaticModel
childrenFieldstaticModel
fieldMapstaticModel
fieldsstaticModel
idFieldstaticModel

Grouping

Identification

keyModel

Integration

vueColumn

Interaction

collapsedColumn
draggableColumn
editorColumn
groupableColumn
hideableColumn
resizableColumn
sealedColumn
sortableColumn

JSON

jsonModel

Layout

alignColumn
hiddenColumn
lockedColumn
minWidthColumn
regionColumn

Lifecycle

configBase

Linked records

hasLinksModelLink
isLinkedModelLink
recordLinksModelLink

Menu

Merge cells

mergeableColumn

Misc

localeHelperLocalizable
localeManagerLocalizable
stmModelStm
tagsColumn
treeColumn

Parent & children

allChildrenTreeNode
childLevelTreeNode
firstChildTreeNode
isLeafTreeNode
isLoadedTreeNode
isParentTreeNode
isRootTreeNode
lastChildTreeNode
nextSiblingTreeNode
parentTreeNode
parentIdTreeNode

Rendering

cellClsColumn
clsColumn
iconColumn
rendererColumn
tooltipColumn

Summary

sumColumn
summariesColumn

Functions

77

Configuration

applyDefaultsstaticBase

Editing

copyModel
getDataModel
removeModel
setModel

Events

Fields

addFieldstaticModel
getModel
processFieldstaticModel
removeFieldstaticModel

Identification

asIdstaticModel

JSON

toJSONModel

Lifecycle

destroystaticBase

Misc

equalsModel
initClassstaticBase
isOfTypeNamestaticBase
linkModelLink
mixinstaticBase
optionalLstaticLocalizable

Other

hideColumn
LstaticLocalizable
onEvents
relayAllEvents
showColumn
toggleColumn
triggerEvents
unEvents

Parent & children

appendChildTreeNode
bubbleTreeNode
bubbleWhileTreeNode
containsTreeNode
isExpandedTreeNode
removeChildTreeNode
traverseTreeNode

Events

5

Event handlers

5

Typedefs

3

"Add New..." column combobox item data.

ParameterTypeDescription
textString

Column entry text in the combobox

valueGridColumnConfig

Column configuration