Our state of the art Gantt chart


Post by Bhava »

Hi team,
I have data as below:

  "newarray": [
                  {
                    "id": 1,
                    "from": "PHO",
                    "to": "MNL",
                  },
                  {
                    "id": 2,
                    "from": "MNL",
                    "to": "AHM"
                  }
                ]       
MicrosoftTeams-image (20).png
MicrosoftTeams-image (20).png (110.38 KiB) Viewed 614 times

How i can create a store just like baselines in the above screenshot


Post by saki »

There is currently no automated or configurable way of creating user-defined 1:many stores in a model. Baselines are created automatically by the Gantt component. You could create such store manually though, populating it with the data from the json response.

I have created a feature request: https://github.com/bryntum/support/issues/3222


Post by Bhava »

thank you


Post by pmiklashevich »

I've found a part of the code where you define the relation:

lib/Scheduler/model/ResourceTimeRangeModel.js

    static get relationConfig() {
        return [
            /**
             * The associated resource, retrieved using a relation to a ResourceStore determined by the value assigned
             * to `resourceId`. The relation also lets you access all time ranges on a resource through
             * `ResourceModel#timeRanges`.
             * @member {Scheduler.model.ResourceModel} resource
             */
            { relationName : 'resource', fieldName : 'resourceId', store : 'resourceStore', collectionName : 'timeRanges', nullFieldOnRemove : true }
        ];
    }

It would be nice if you can make this public. Thanks.

Pavlo Miklashevych
Sr. Frontend Developer


Post by alex.l »

Hi Pavel,

Could you please describe why do you want this public?

All the best,
Alex


Post by pmiklashevich »

Hi Alex,

I have lots of related models. For example, I have Group Store, which looks like:

{
  id : 1,
  title : 'Forwards',
  players: [
    { id : 1, name : 'Kylian Mbappe' } ,
    { id : 2, name : 'Lionel Messi' },
    { id : 3, name : 'Neymar' }
  ],
}

So it's obvious there is a Players Store holding info of all players, and there is a Groups store, which organises players in some groups, i.e. Forwards. Every group has "players" field which would be nice to have turned into a Store of Records instead of simple array of objects.

Please suggest the best way to achieve this.

Pavlo Miklashevych
Sr. Frontend Developer


Post by alex.l »

Ok, I see. So you need it for Model, not for ResourceTimeRange :). That's clear now.
We have a ticket for that https://github.com/bryntum/support/issues/3222
I will notify about your request to raise the priority.

All the best,
Alex


Post Reply