DayPilot.Scheduler.contextMenuSelection

The contextMenuSelection property (DayPilot.Menu) sets the context menu used for the JavaScript Scheduler time range selection.

Default Value

null

Example

contextMenuSelection: new DayPilot.Menu({
  items: [
    {
      text: "Create new event", 
      onClick: args => { 
        const range = args.source;
        dp.events.add({
          start: range.start,
          end: range.end,
          resource: range.resource,
          id: DayPilot.guid(),
          text: "New event"
        });
      }
    },
    {
      text: 'Show start',
      onClick: args => {
        const range = args.source;
        DayPilot.Modal.alert(`Start: ${range.start}`);
      }
    },
    {
      text:'-'
     },
    {
      text: 'Clear selection',
      onClick: args => dp.clearSelection()
    }
  ]
})

Related Properties