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

Angular show() not working

Asked by Murry
8 days ago.

Hi DayPilot Support,
I was using heightSpec = Parent100Pct and need to recalculates the dimensions when other element was hide else the scheduler will leaves many blank space below

I was using DayPilot scheduler show() to do it and write it as a function to let button trigger it
https://api.daypilot.org/daypilot-scheduler-show/

@ViewChild('scheduler', { static: false }) scheduler: DayPilotSchedulerComponent;

public reSizeScheduler() {
    this.scheduler.control.show();
  }

However when i trigger this reSizeScheduler() will hit error of
ERROR TypeError: Cannot read property 'control' of undefined
Answer posted by Dan Letecky [DayPilot]
7 days ago.

In order to access the component using "this" you need to use the arrow function notation:

  reSizeScheduler = () => {
    this.scheduler.control.show();
  }

See also:
https://www.typescriptlang.org/docs/handbook/functions.html#this-parameters-in-callbacks

New Reply
This reply is
Your name (optional):