Hi,
Which version of Gantt did you try this on?
So here i am using gantt angular wrapper and tried as u suggested below -
const gantt: any = this.gantt.ganttInstance;
const taskStore = gantt.taskStore;
taskStore.data = JSON.parse(taskStore.json);
getting err-
Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.
I have re-tried to reproduce the issue in 4.0.0-beta-1 (same as yours) and in our Angular rollups demo. I have changed onShowRollups
method in app.component.ts
to read the following:
onShowRollups(event : any) {
if('action' === event.type) {
const taskStore = this.gantt.ganttInstance.taskStore;
// @ts-ignore
taskStore.data = JSON.parse(taskStore.json);
console.log(`taskStore.data set`)
// this.gantt.ganttInstance.features.rollups.disabled = !event.source.checked;
}
}
Clicking on Show Rollups in the header then does not cause the error to show, only the expected console log output.
Post please a showcase (ideally a modified example) so that we can take it from there and analyze and fix the problem.
Hi,
Its working fine now in beta-2 version, Thank you.
but want to know how could i get json data for -
1) task assigned for particular Resources?
2) dependencies
3) calendar
Tried for resources -
const resourceStore = this.gantt.ganttInstance.project.resourceStore;
resourceStore.data = JSON.parse(resourceStore.json);
it works but same way not works for dependency's..