search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Event handling method

Asked by daniels
4 years ago.

We are using Scheduler within an Angular 5 component. Is there a location other than the Scheduler's config object that event handlers (eg. onResourceExpand) can be defined?

Answer posted by Dan Letecky [DayPilot]
4 years ago.

You can define the event handlers directly on the DayPilot.Scheduler object (which is available as DayPilotComponent.control).

Just note that DayPilotComponent.control is not available before AfterViewInit:

import {Component, ViewChild, AfterViewInit} from "@angular/core";
import {DayPilotSchedulerComponent} from "daypilot-pro-angular";

  selector: 'angular2-scheduler-example',
  template: `<daypilot-scheduler #scheduler1></daypilot-scheduler>`
export class AppComponent implements AfterViewInit {

  scheduler: DayPilotSchedulerComponent;

  ngAfterViewInit(): void {
    this.scheduler.control.onResourceExpand = (args) => { this.scheduler.control.message("Expanded"); };

See also:
This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.