Our state of the art Gantt chart


Post by jhughesoneplan »

I am trying to add a column on the fly to the gantt. If you do the following in your advanced example you will get an error:

change the code for complexity to alwaysWrite

{ name : 'complexity', type : 'number', alwaysWrite: 'true' }

Then add a column:

gantt.columns.add({text: 'Test', field: 'Custom_Test', id: 'Custom_Test'})

Then go make a change to the data on 1 item in that column

Then in the console do: gantt.project.changes.

Is there a way to resolve this issue? It appears that if you add a column that does not exist in the model then this happens. I cant seem to find a way to add/remove fields from a model. And should I need to add this to the model?


Post by marcio »

Hey jhughesoneplan,

Thanks for reaching out.

Do you have the Custom_Test field set in the task model? If not, that's the reason that is not working, you need to have that custom field set in the model, as it's described here.

Best regards,
Márcio


Post by jhughesoneplan »

No it is not in the model. Notice my last sentence.

Is there a way to resolve this issue? It appears that if you add a column that does not exist in the model then this happens. I cant seem to find a way to add/remove fields from a model. And should I need to add this to the model?


Post by marcio »

Hey,

So, it would be best if you had custom fields in the model, we have a section in our guides on how to update the model that is used in the project/stores https://bryntum.com/products/gantt/docs/guide/Gantt/data/project_data#adding-custom-fields-to-entities

If you need more clarification, please let us know.

Best regards,
Márcio


Post by jhughesoneplan »

I don't see how to add a field after the model is created.


Post by alex.l »

All the best,
Alex


Post Reply