Page 1 of 1

[ANGULAR] Event when click on empty scheduler without resource

Posted: Tue Jan 31, 2023 12:59 pm
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


Re: [ANGULAR] Event when click on empty scheduler without resource

Posted: Tue Jan 31, 2023 1:28 pm
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


Re: [ANGULAR] Event when click on empty scheduler without resource

Posted: Tue Jan 31, 2023 3:45 pm
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?


Re: [ANGULAR] Event when click on empty scheduler without resource

Posted: Tue Jan 31, 2023 3:58 pm
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