Premium support for our pure JavaScript UI components


Post by cubrilo »

Hi,

Is there a way to allow having duplicate resources in scheduler tree. I have groups of users as tree resource model and some users can be members of more than one group thus I get an error when I try to use it with default scheduler tree. Also those users have their events which would then also be duplicated but I guess this is not a problem and would show up ok if the users issue can be solved.


Post by mats »

'id' has to be unique I'm afraid, but you can simply prefix the parent id before the child id to make repeating children "unique"


Post by cubrilo »

Yes, that works fine, but what about Events? They have resourceId that links it to id of the User and then the connection is lost. Is there a way to alter the linking mechanism so that I might tell it to separate the User id and recognise whose event it is and make it show on every row where the duplicated user is shown when groups are expanded?


Post by mats »

Yes, you also have to set the correct resourceId for your events as well. No other way to solve this I'm afraid.


Post by cubrilo »

I can set it but it will be tied up that user in only one group. Is there some config or function in event store that I can override, that tells the event store how to look at the resource id property when it needs to pair it up?


Post by alex.l »

Hi cubrilo,

There is no build-in functionality to support this.
You may listen to store update event(s)
https://bryntum.com/docs/gantt/#Gantt/data/ResourceStore#event-update
https://bryntum.com/docs/gantt/#Scheduler/data/EventStore#event-update
and implement that logic there to update dependent data.
Also it might be helpful to take a look at this example, it shows how to use multi-assignment for events: https://bryntum.com/examples/scheduler/multiassign/

All the best,
Alex

All the best,
Alex


Post Reply