Our state of the art Gantt chart


Post by johan.isaksson »

Hi,

Which version of Gantt did you try this on?

Best regards,
Johan Isaksson

Post by NARESH.RAI »

latest version Gantt - 4.0 beta -1


Post by saki »

I tried to reproduce it with 4.0.0-beta-2 but it works:

taskstore-json.gif
taskstore-json.gif (238.76 KiB) Viewed 1146 times

Are there any additional steps needed to reproduce the problem or am I doing something differently?


Post by NARESH.RAI »

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.

Post by NARESH.RAI »

Quick overview of the error - attached

Attachments
gantt-save.JPG
gantt-save.JPG (45.15 KiB) Viewed 1145 times

Post by mats »

Naresh, have you tried using the beta-2 version?


Post by saki »

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.


Post by NARESH.RAI »

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..

Last edited by NARESH.RAI on Thu Sep 24, 2020 11:38 am, edited 1 time in total.

Post by saki »

I'm glad it works for you.

Post please the above new question in a new thread.


Post Reply