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