Page 1 of 1

[ANGULAR] Pass resources manually to project

Posted: Thu Sep 10, 2020 2:14 pm
by NARESH.RAI

Hi,

In current examples all data is loaded from json file from transporter.
I want to pass resources from other object instead of json file.

1) How could i pass resources to my gantt project ?
2) how could we load ptoject json data from variables instead of using transporter as json file?


Re: [ANGULAR] Pass resources manually to project

Posted: Thu Sep 10, 2020 2:59 pm
by fabio.mazza

Hi Naresh. You can add tasks using https://www.bryntum.com/docs/gantt/#Gantt/data/TaskStore#function-add and resources using https://www.bryntum.com/docs/gantt/#Gantt/data/ResourceStore#function-add directly to your store, examples:

gantt.taskStore.add(yourTask(s));
gantt.resourceStore.add(yourResource(s));

Re: [ANGULAR] Pass resources manually to project

Posted: Fri Sep 11, 2020 8:51 am
by NARESH.RAI

Thanks!

But my 2nd question that how could i load or sync data without using below model?
Is there any other way so i can save my data manually using angular api ?

  transport: {
        load: {
          url: "./assets/datasets/sampleData.json",
        },
        sync: {
          url: "abc.php",
        },
      },

Re: [ANGULAR] Pass resources manually to project

Posted: Fri Sep 11, 2020 10:40 am
by alex.l

Hi NARESH.RAI,

You can set/get data directly to any store using https://bryntum.com/docs/gantt/#Scheduler/data/EventStore#config-data

All best,
Alex