I am using new version on Bryntum Gantt with React. I am curious to know that is it possible to add task or project dynamically without using "Create" button. I want to achieve functionality where user could have separate field where he could enter task name and when click on add, it could add in gantt chart.
To add a task dynamically you just add a record to the task store:
gantt.taskStore.add({ name : 'New task', duration : 1 })
And a project is just an instance of the ProjectModel class.
So you can create an instance in the runtime and assign it to the gantt. Something like this for example:
const project = new ProjectModel({
startDate : new Date(),
tasksData : [...],
dependenciesData : [...],
...
});
gantt.project = project;
So can I use this from another react component? I am calling this panel from my react component and I have one textbox in that component so when I hit "Add" it could add task in chart. so for this do I need to expose this so I any component could use?
Sorry I am learning both react and gantt so asking silly questions.