The contextMenuResource property (DayPilot.Menu) specifies the context menu used for JavaScript Scheduler row headers.
DayPilot.Scheduler.contextMenuResourcenullAssign a DayPilot.Menu instance to define actions available for row headers. Menu item handlers receive the clicked row as args.source.
JavaScript
const dp = new DayPilot.Scheduler("dp", {
contextMenuResource: new DayPilot.Menu({
items: [
{
text: "Edit",
onClick: args => dp.rows.edit(args.source)
},
{
text: "-"
},
{
text: "Delete",
onClick: args => dp.rows.remove(args.source)
}
]
}),
// ...
});
dp.init();Angular
<daypilot-scheduler [config]="config"></daypilot-scheduler>contextMenuResource = new DayPilot.Menu({
items: [
{
text: "Edit",
onClick: args => DayPilot.Modal.alert(String(args.source))
},
{
text: "-"
},
{
text: "Delete",
onClick: args => DayPilot.Modal.alert(String(args.source))
}
]
});config: DayPilot.SchedulerConfig = {
contextMenuResource: this.contextMenuResource,
// ...
};React
<DayPilotScheduler
contextMenuResource={contextMenuResource}
{/* ... */}
/>const contextMenuResource = new DayPilot.Menu({
items: [
{
text: "Edit",
onClick: args => DayPilot.Modal.alert(String(args.source))
},
{
text: "-"
},
{
text: "Delete",
onClick: args => DayPilot.Modal.alert(String(args.source))
}
]
});Vue
<DayPilotScheduler
:contextMenuResource="contextMenuResource"
<!-- ... -->
/>const contextMenuResource = new DayPilot.Menu({
items: [
{
text: "Edit",
onClick: args => DayPilot.Modal.alert(String(args.source))
},
{
text: "-"
},
{
text: "Delete",
onClick: args => DayPilot.Modal.alert(String(args.source))
}
]
});DayPilot.Scheduler.contextMenu