Our powerful JS Calendar component


Post by braincept »

Hi Team,

We are facing one more issue in the bryntum calendar. We are unable to find the angular example of dynamic loading of events. In the attached image, I have highlighted the click events on which we wanted to load the events.

If you guys have some examples, please share with us.

Best Regards,
Gaurav

Attachments
Screenshot 2020-11-26 at 3.21.57 PM.png
Screenshot 2020-11-26 at 3.21.57 PM.png (301.64 KiB) Viewed 746 times

Post by saki »

If you want to load the events yourself then the easiest way is to utilize the existing onCalendarEvents method in app.component.ts (I'm referring to Filtering Angular demo). This is the central "hub" of all calendar events where we would take dateRangeChange that fires when user clicks on any spot you highlighted on the above screenshot.

The code may look like follows:

  onCalendarEvents(event: any): void {
    if(event.type === 'daterangechange') {
      const {old:oldRange, new:newRange, source:calendar} = event;
      console.log('loading new events for ', calendar);
      console.log('oldRange: ', oldRange);
      console.log('newRange: ', newRange);
    }

with your load logic instead of console.logs.

Another option would be to use LoadOnDemand feature where you would let events loading to the underlying CrudManger.


Post by braincept »

Thanks Saki. I will try the solution


Post Reply