Our state of the art Gantt chart


Post by prem.k@zetwerk.com »

Hi Team,

I have to load (n-k) columns and n columns based on some condition and respective data as well.

I tried with

        this.gantt.columns.add({text : 'Testing', region : 'locked', field: 'trackedBy'});

this but suppose we have to 15 extra columns, do we need to write above code 15 times? Is there any other approach where i can just set array of columns in config and refresh the gantt view, something like

 this.ganttConfig.columns = this.trackingMode === 'ABC' ? ABCColumns : DEFColumns;

then refresh gantt view.


Post by sergey.maltsev »

Hi!

If you have all columns data before creating Gantt instance you could use this config:
https://www.bryntum.com/docs/gantt/#Gantt/view/Gantt#config-columns

 this.ganttConfig.columns = [
  {text : 'Testing', region : 'locked', field: 'trackedBy'},
  ...
  ];

If you load columns asynchronously after Gantt instance is created you may add them to Column's store data as array:
https://www.bryntum.com/docs/gantt/#Grid/data/ColumnStore#function-add

this.gantt.columns.add([
  {text : 'Testing', region : 'locked', field: 'trackedBy'},
  ...
]);

Post by prem.k@zetwerk.com »

Thank you so much Sergey.


Post Reply