DayPilot.Menu Constructor

The DayPilot.Menu constructor creates a menu instance. The current constructor usage passes an array of menu items as a parameter.

Declaration

new DayPilot.Menu([options])

Parameters

  • options (object) - optional object with menu event handlers and properties (including menu items).

Notes

The array can mix command-based menu items with custom click handlers.

Example

const menu = new DayPilot.Menu({
  items: [
    { text: "Delete this event", onClick: args => calendar.events.remove(args.source) },
    { text: "Custom command", onClick: args => console.log(args.source) },
    {
      text: "Show event start",
      onClick: args => {
        DayPilot.Modal.alert(args.source.start().toStringSortable());
      }
    }
  ]
});

See Also

DayPilot.Menu Class

DayPilot.Menu.items

Menu Items [doc.daypilot.org]

Menu Customization [doc.daypilot.org]

Submenus [doc.daypilot.org]

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript