Using dp.onBeforeEventRender I have a switch based on a variable "status". I would like my context menu to be different for each one of these cases.
args.e.contextMenuClientName seems to be the way to set this menu. But i am unable to get it to work. Here is a simplified version of my code:
var menuTest = new DayPilot.Menu([
{text:"Customer quick view", onclick: function() { loadCustomerInfo(this.source.value());} },
{text:"Guest checked in", onclick: function() {update_reservation_status('Checked in',this.source.value()); } },
{text:"Guest checked out", href: "edit2.php?id={0}"},
{text:"Cancel reservation", href: "cancel.php?q={0}"},
{text:"Lock/unlock reservation", onclick: function() {update_reservation_status_lock('lockchange',this.source.value()); } }
]);
menuTest.clientObjectName = "test";
dp.onBeforeEventRender = function(args) {
switch (args.e.status) {
case "Confirmed":
args.e.contextMenuClientName = "test";
break;
}
}