Premium support for our pure JavaScript UI components


Post by jan@veovo »

Hi Bryntum Team,
I'm looking for event that is triggered on empty scheduler click without any resource.
I tried scheduleClick, scheduleMouseDown and cellClick but all of them seems to require clicking on some particular element.
What I want to achieve is: We have two schedulers, one is empty and when selecting some event on one scheduler and then clicking somewhere on empty one - then the event is removed from the first one and added to empty one with new resource created along the way. Additionally, we display some time range to where it can be put on empty scheduler but I also could not find an event triggered by click on TimeRange.
One hack that comes to my mind is to add some dummy resource that will fill empty space and then scheduleClick works. Do you have any other suggestion on how to achieve that?

Thanks,
Jan


Post by tasnim »

Hello,

You could use https://bryntum.com/products/scheduler/docs/api/Scheduler/view/Scheduler#event-catchAll listen to listen for an element click

Here is an example

    listeners : {
        catchAll(event) {
            const { type } = event;
            if (type === 'beforeelementclick') {
                console.log(event);
            } 
        }
    }

Here is a video of how it's working

Attachments
PowerToys_iQNOjPHtWd.mp4
(629.72 KiB) Downloaded 20 times

Post by jan@veovo »

Hi Tasnim,
Thanks a lot for quick response, there are a lot of events going on with catchAll, so I can figure something out with it. One more question - is it possible to attach event listener directly to rendered time range element?


Post by tasnim »

Yes. Sure

You could use https://bryntum.com/products/scheduler/docs/api/Scheduler/feature/TimeRanges#event-timeRangeHeaderClick event for timeRanges feature
And if you're using resourceTimeRanges then you could use this https://bryntum.com/products/scheduler/docs/api/Scheduler/feature/ResourceTimeRanges#event-resourceTimeRangeClick

Hope it would help

Good Luck :),
Tasnim


Post Reply