html5-scheduler-row-header-context-menu.png

You can assign a custom context menu to row headers.

See also row header active areas.

ASP.NET WebForms

Use ContextMenuResourceID property to assign the context menu.

<DayPilot:DayPilotMenu ID="DayPilotMenuRes" runat="server"  CssClassPrefix="menu_default">
  <DayPilot:MenuItem Action="CallBack" Command="Insert" Text="Add child" />
  <DayPilot:MenuItem Text="-" Action="JavaScript"></DayPilot:MenuItem>
  <DayPilot:MenuItem Action="CallBack" Command="Delete" Text="Delete" />
  <DayPilot:MenuItem Action="CallBack" Command="DeleteChildren" Text="Delete children" />
  <DayPilot:MenuItem Text="-" Action="JavaScript"></DayPilot:MenuItem>
  <DayPilot:MenuItem Action="JavaScript" JavaScript="alert(e.name + '\n' + e.value);"
      Text="Show resource details" />
</DayPilot:DayPilotMenu>

<DayPilot:DayPilotScheduler 
  ID="DayPilotScheduler1" 
  runat="server" 
  ...
  ContextMenuResourceID="DayPilotMenuRes"
  />

ASP.NET MVC

@Html.DayPilotMenu("menu_resource", new DayPilotMenuConfig {
  CssClassPrefix = "menu_default",
  Items = new DayPilot.Web.Mvc.MenuItemCollection
    {
      new DayPilot.Web.Mvc.MenuItem { Text = "Open", Action = MenuItemAction.JavaScript, JavaScript = "alert(e.value + ' ' + e.name);"}
    }
  })

@Html.DayPilotScheduler("dps", new DayPilotSchedulerConfig {
  BackendUrl = ResolveUrl("~/Scheduler/Backend"),
  ContextMenuResource = "menu_resource",
  ...
})

Make sure the menu is declared first.

JavaScript

dp.contextMenuResource = new DayPilot.Menu({items: [
    {text:'Open', onclick:function() { var e = this.source; var command = this.item.command; alert(e.value + ' ' + e.name); }}
  ]});