Page 1 of 1

Scheduler - Detect clicked nested events

Posted: Tue Mar 21, 2023 12:05 am
by guillaume.morin

Using this example:
https://bryntum.com/products/scheduler/examples/nestedevents/

Is it possible to detect the nested event (if any) that was clicked or right-clicked ?
I'd like to add items to the context-menu that will make use of which nested-event was clicked.

I'm using mode: 'vertical' if that matters.


Re: Scheduler - Detect clicked nested events

Posted: Tue Mar 21, 2023 12:44 am
by marcio

Re: Scheduler - Detect clicked nested events

Posted: Tue Mar 21, 2023 12:48 am
by guillaume.morin

Thanks, I see these events receive an eventRecord, but I want the nested-event (if any where the user clicked).
Using the example above, I want to know when the nested "Outro" is clicked on Celia ressource.

2023-03-21_13-27.png
2023-03-21_13-27.png (53.66 KiB) Viewed 372 times

Re: Scheduler - Detect clicked nested events

Posted: Tue Mar 21, 2023 7:53 am
by tasnim

Hi,

That sounds like a bug. We'll investigate it. Here is the ticket to track progress https://github.com/bryntum/support/issues/6412

Good Luck :),
Tasnim


Re: Scheduler - Detect clicked nested events

Posted: Tue Mar 21, 2023 3:07 pm
by guillaume.morin

Any guidance on how to achieve this myself in the meantime ?

I managed to get the nested html element with:

listeners: {
   eventClick: function(e) {
      console.log(e.event.target.closest(".nested"));
   }
}

Now I need to get the nested-event record linked to the html element (the one within the "agenda" array).
I guess I could set some data-* attribute on the html element, that would allow me to uniquely locate the record from agenda array.

Is this the best way to go ?


Re: Scheduler - Detect clicked nested events

Posted: Tue Mar 21, 2023 3:36 pm
by tasnim

Hi,

Unfortunately, I don't know any workaround for that. You could check out this demo https://bryntum.com/products/schedulerpro/examples/nested-events/

I would suggest you try the approach of this demo
It will work fine

schedulerPro.on('eventClick', (event) => console.log(event.eventRecord));

Re: Scheduler - Detect clicked nested events

Posted: Tue Mar 21, 2023 3:41 pm
by guillaume.morin

Sadly this example won't work with mode: 'vertical', which I need


Re: Scheduler - Detect clicked nested events

Posted: Tue Mar 21, 2023 6:06 pm
by marcio

Hey,

Could you share your configuration with the nested events and how did you configure the vertical mode?? With that would be a lot easier for us to provide a workaround for you.

That suggestion that Tasmin mentioned is triggering an error? Why is that not working for you? What's the error that you're getting?


Re: Scheduler - Detect clicked nested events

Posted: Tue Mar 21, 2023 7:14 pm
by guillaume.morin

Just add mode: 'vertical' to the example provided by Tasnim:
https://bryntum.com/products/schedulerpro/examples/nested-events/

It renders nothing and there is a javascript error in the console:
Uncaught (in promise) TypeError: h[bGN(...)] is not a function

I was told nested events are not supported in vertical mode a couple of months ago... I get from your response that it should be supported now ?


Re: Scheduler - Detect clicked nested events

Posted: Tue Mar 21, 2023 7:19 pm
by mats

It's supported only in the basic Scheduler, not in Pro yet. We opened this ticket now to look into it https://github.com/bryntum/support/issues/6425