Premium support for our pure JavaScript UI components


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


Post by marcio »

Best regards,
Márcio


Post 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 246 times
Last edited by guillaume.morin on Tue Mar 21, 2023 7:28 pm, edited 1 time in total.

Post 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


Post 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 ?

Last edited by guillaume.morin on Tue Mar 21, 2023 3:44 pm, edited 1 time in total.

Post 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));

Post by guillaume.morin »

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


Post 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?

Best regards,
Márcio


Post 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 ?


Post 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


Post Reply