Page 1 of 2

[INFO REQ] Scheduler with multiple resource types

Posted: Wed Jun 16, 2021 12:33 pm
by applysia

I wonder how I would implement the scheduler with different types of resources. At the moment I am already using the event, assignment and resource stores, which allow a many-to-many relationship between events and resources. I would like to implement this construct but with an additional resource type. So that I effectively have two combo boxes with an resource assignment in the event editor.

Is there any way to have multiple resource/assignment stores? I have already tried modelling the relationship in the event editor, but as far as I can tell, there is no array or object field type that would make this possible.

Thank you very much for your support!


Re: [INFO REQ] Scheduler with multiple resource types

Posted: Wed Jun 16, 2021 1:51 pm
by mats

This is not supported no, but if you explain in a bit more detail we should be able to give you some advice. You want to assign two sets of resources to a single event? And you cannot do this using our current multi-select resource combo?


Re: [INFO REQ] Scheduler with multiple resource types

Posted: Wed Jun 16, 2021 5:36 pm
by applysia

So far I am using the following model:

class MyEvent extends EventModel {

  static get fields() {
    return [
      { name: 'resourceType2Id', type: 'string', persist: true },
    ];
  }
}

An as I wrote, I'm using the event, assignment and resource (for resourceType1) stores to map the many-to-many relationship between resource type 1 and events. But now I need to assign several resources of type 2 to an event, which means that I can no longer use the reference to a single ID in the event model.


Re: [INFO REQ] Scheduler with multiple resource types

Posted: Thu Jun 17, 2021 7:49 am
by mats

It could still be done using one multi-assignment combo box, or you definitely want it done in two separate ones?


Re: [INFO REQ] Scheduler with multiple resource types

Posted: Thu Jun 17, 2021 9:39 am
by applysia

Yes, I think two combo boxes would be better, as the types should be semantically separated. Also, only the one type of resource should be displayed as columns.


Re: [INFO REQ] Scheduler with multiple resource types

Posted: Thu Jun 17, 2021 10:21 am
by saki

Could you have one resource store with a custom modelClass introducing the resourceType (type 1 or type 2) and filter the stores of combo boxes depending on which resource is being assigned?


Re: [INFO REQ] Scheduler with multiple resource types

Posted: Thu Jun 17, 2021 10:58 am
by applysia

That would probably solve the problem with the different combo boxes. Is there also a way to filter the displayed resource columns? And how do you filter the stores of the combo boxes? :D


Re: [INFO REQ] Scheduler with multiple resource types

Posted: Thu Jun 17, 2021 12:35 pm
by pmiklashevich

Please see my reply here: viewtopic.php?p=81692#p81692
I hope this is exactly what you're looking for.

We have opened a feature request. Please subscribe to the ticket to get notified when it's done.
https://github.com/bryntum/support/issues/3042


Re: [INFO REQ] Scheduler with multiple resource types

Posted: Wed Jul 07, 2021 3:49 pm
by applysia

Hi pmiklashevich,

thanks for your reply. The example you provided helped a lot. In the example the "master" store was grouped by the type field, but my use case requires one type to be hidden entirely. How would could I solve this?


Re: [INFO REQ] Scheduler with multiple resource types

Posted: Wed Jul 07, 2021 7:13 pm
by Maxim Gorkovsky

Hello.
If I understood you correctly, you can try to filter out records with certain type from the store:
https://bryntum.com/docs/gantt/#Core/data/Store#function-filter