Our state of the art Gantt chart


Post by ionelabebeselea13 »

Hello,

I am trying to integrate your Gantt component and mapping our DB data to be compatible to your TaskModel class.

The idea is that the data is received from the server through saga into a reducer. Afterwards, I have tried extending the TaskModel class to add new necessary fields and map the API data to the new created model, but I am also required to mapp all the other 150 fields, which is very tiresome.

Is there a best practice on how to do that? Getting an array of Tasks data from the API through the reducer and then mapping it to TaskModel, but adding new fields?

In our application we use Functional Components and typescript.

Thank you so much, I am awaiting your answer.


Post by alex.l »

Hi ionelabebeselea13,

There is no best practices to add fields to the data model, unfortunately. Having 150 fields in a model is not so common thing and that's not so predictable what config should be used in that field, maybe it's text string, or date string (maybe invalid date string), or something else that is not always obvious without data model notation.
There is a method https://bryntum.com/docs/gantt/api/Gantt/model/TaskModel#function-addField-static
that you may use in some loop by properties of first data object you received. Maybe it helps you to go faster.

All the best,
Alex


Post Reply