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

You can assign a custom context menu to row headers.

See also row header active areas.

JavaScript

You can define the context menu using contextMenuResource property:

dp.contextMenuResource = new DayPilot.Menu({
  items: [
    {
      text: "Edit...",
      onClick: function(args) {
        var row = args.source;
        DayPilot.Modal.prompt("Resource name:", row.name).then(function(args) {
          if (!args.result) {
            return;
          }
          row.data.name = args.result;
          dp.update();
        });
      }
    },
    {
      text: "Delete",
      onClick: function(args) {
        var row = args.source;
        dp.rows.remove(row);
        dp.message("Deleted");
      }
    }
  ]
});

Tutorial:

Angular

Tutorial:

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.