Custom Column created by end-user and not by code


#1

Hi there, is there a way for the end-user to create a custom column?
The thing is I do not want to create every time when is needed a custom column through code. It would be great if this creation would be left for the end-user. Ideally it would work similar to the way MS Project works.
Is that possible?


#2

Hello Pedro,
There is no built-in way to do that, but you can implement it by using Gantt API and Javascript.

You just need to prepare a template for the user to generate a new column. Then you need to add it to the gantt.config.columns array:
https://docs.dhtmlx.com/gantt/api__gantt_columns_config.html
Here is an example of how it can be implemented:
http://snippet.dhtmlx.com/5/2df0b1043


#3

Hi @ramil thanks for your answer. In addition, is it possible for the end user to create custom formulas like (Custom field#1 * Custom field#2)/custom field #3
Thanks.


#4

Hello Pedro,
There is no easy way to add such formulas, but you can add a text area for the template function and evaluate it when adding a column.
You will be able to add the Javascript code there and show any data or HTML elements:
http://snippet.dhtmlx.com/5/cc6eda263