Our state of the art Gantt chart


Post by shaveta »

Hi,

I am trying to add columns dynamically in gantt, for that i have used below line of code

window.gantt.columns.add({'field':'startDate','type':'date','text':'StartDate'});

Start Date column get added successfully, how can i remove this column from "New Column" dropdown list, so that user can't add it again?


Post by fabio.mazza »

Hi shaveta,

We already have a feature request opened about this feature, you can track it using this link: https://github.com/bryntum/support/issues/1492

For now, you can filter the dropdown store excluding all records related to columns that already are visible, like:

const [addNewColumn] = gantt.columns.findByField('type', 'addnew');

addNewColumn.data.columnCombo.store.filter(colRec => {
    // your logic here
});

If you have any question, please let us know.

Best regards,
Fabio


Post Reply