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:
- the class should have a static property
typewith unique string value that will identify the column. - the class should be registered with the call to ColumnStore.registerColumnType.
- the class should have a static property
isGanttColumnwith truthy value. - the class should have a static
textproperty 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
Configs
83Common
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'
}
});
}
}
]
});
| Parameter | Type | Description |
|---|---|---|
data | Object | Wrapping object |
data.config | StoreConfig | The combo store configuration. |
data.config.data | AddNewColumnComboModelConfig[] | The store data. |
data.column | AddNewColumn | The column. |
Integration
Interaction
Menu
Misc
Rendering
Properties
154
Properties
154Common
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'
}
});
}
}
]
});
| Parameter | Type | Description |
|---|---|---|
data | Object | Wrapping object |
data.config | StoreConfig | The combo store configuration. |
data.config.data | AddNewColumnComboModelConfig[] | The store data. |
data.column | AddNewColumn | The column. |
Class hierarchy
Other
Returns the combo box field rendered into the header of this column
Editing
Integration
Interaction
JSON
Menu
Misc
Parent & children
Rendering
Functions
77
Functions
77Configuration
Editing
Events
Identification
Misc
Other
Parent & children
Events
5
Events
5Event handlers
5
Event handlers
5Typedefs
3
Typedefs
3"Add New..." column combobox item data.
| Parameter | Type | Description |
|---|---|---|
text | String | Column entry text in the combobox |
value | GridColumnConfig | Column configuration |