DayPilot.Switcher.addNavigator

The addNavigator() method adds a date picker component to the switching logic.

Use this method as an alternative to setting options.navigator in the DayPilot.Switcher Constructor.

Declaration

DayPilot.Switcher.addNavigator(nav)

Parameters

  • nav (DayPilot.Navigator) - linked date picker instance

Example

const nav = new DayPilot.Navigator("nav", {
  // ...
});
nav.init();

const day = new DayPilot.Calendar("dpDay", {
  // ...
});
day.init();

const week = new DayPilot.Calendar("dpWeek", {
  // ...
});
week.init();

const switcher = new DayPilot.Switcher({
  triggers: [
    { id: "buttonDay", view: day },
    { id: "buttonWeek", view: week },
  ],
});

switcher.addNavigator(nav);

See Also

DayPilot.Switcher Constructor

DayPilot.Switcher Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript