1 - On cell/ date selection wanted to open context menu - is it possible? if yes snippet please
2 - On click on booking want to open context menu - is it possible? if yes snippet please
For Reference Code is Here
/*************************************
<script type="text/javascript">
var nav = new DayPilot.Navigator("nav");
nav.selectMode = "month";
nav.showMonths = 3;
nav.skipMonths = 3;
nav.onTimeRangeSelected = function (args) {
loadTimeline(args.start);
loadEvents();
};
nav.init();
$("#timerange").change(function () {
switch (this.value) {
case "week":
dp.days = 7;
nav.selectMode = "Week";
nav.select(nav.selectionDay);
break;
case "month":
dp.days = dp.startDate.daysInMonth();
nav.selectMode = "Month";
nav.select(nav.selectionDay);
break;
}
});
function autocellWidth() {
dp.cellWidth = 40; // reset for "Fixed" mode
dp.cellWidthSpec = "Auto"; //$(this).is(":checked") ? "Auto" : "Fixed";
dp.update();
}
$("#add-room").click(function (ev) {
ev.preventDefault();
var modal = new DayPilot.Modal();
modal.onClosed = function (args) {
loadResources();
};
modal.showUrl("room_new.php?PHPSESSID=<?= $sid ?>");
});
var dp = new DayPilot.Scheduler("dp");
//dp.heightSpec = "Parent100Pct";
dp.heightSpec = "Max";
dp.height = 550;
dp.allowEventOverlap = false;
//dp.scale = "Day";
//dp.startDate = new DayPilot.Date().firstDayOfMonth();
dp.days = dp.startDate.daysInMonth();
loadTimeline(DayPilot.Date.today().firstDayOfMonth());
dp.eventDeleteHandling = "Disabled";
dp.timeHeaders = [
{groupBy: "Month", format: "MMMM yyyy"},
{groupBy: "Day", format: "d"}
];
dp.eventHeight = 50;
dp.bubble = new DayPilot.Bubble({});
dp.rowHeaderColumns = [
{title: "Room", width: 80}/*,
{title: "Capacity", width: 80},
{title: "Status", width: 80}*/
];
dp.contextMenu = new DayPilot.Menu({items: [
{text: "Edit", onclick: function () {
dp.events.edit(this.source);
}},
{text: "Delete", onclick: function () {
dp.events.remove(this.source);
}},
{text: "-"},
{text: "Change background color", onclick: function () {
var e = this.source;
e.data.backColor = "red";
dp.events.update(e);
}},
{text: "-"},
{text: "Select", onclick: function () {
dp.multiselect.add(this.source);
}},
]});