DayPilot.Calendar.contextMenuSelection

DayPilot Menu object used for time range selection context menu.

Declaration

DayPilot.Calendar.contextMenuSelection (DayPilot.Menu class)

Default Value

null

Example

dp.contextMenuSelection = new DayPilot.Menu({
  items: [
      {
          'text': 'Create new event (JavaScript)', 'onclick': function () {
          dp.events.add(new DayPilot.Event({
              start: this.source.start,
              end: this.source.end,
              text: "New event",
              resource: this.source.resource
          }));
      }
      },
      {'text': '-'},
      {
          'text': 'Show selection details', 'onclick': function () {
          alert('Start: ' + this.source.start + '\nEnd: ' + this.source.end + '\nResource id: ' + this.source.resource);
      }
      },
      {
          'text': 'Clean selection', 'onclick': function () {
          dp.clearSelection();
      }
      }]
});

DayPilot for JavaScript, ASP.NET WebForms, ASP.NET MVC, Java