I made a context menu on event right click handling, everything seems fine, the modal prompt and the alert, but when i tried to open a form, it doesn't show at all, already tried making a simple one just to know if it works, also tried the sample script which was found on the tutorial screen and still nothing shows up, i wonder what seems to be the problem, here is the javascript i made,
var form = [
{name: "Move From", id: "fromDate", dateFormat: "MMMM d, yyyy"},
{name: "Move To", id: "toDate", dateFormat: "MMMM d, yyyy"}
];
dp.onEventRightClick = function(args){
var id = args.e.id();
var start = args.e.start();
var end = args.e.end();
var stat = args.e.resource();
var data = {
fromDate: start,
toDate: end
};
dp.contextMenu = new DayPilot.Menu({
items: [
{text:"Accept Reservation", onclick: function() {
DayPilot.Modal.confirm("Do you want to accept reservation?",{ okText: "Yes", cancelText: "No" }).then(function(args){
if(args.result == "OK"){
var request = 3;
$.ajax({
url:'ajaxScript.php',
type:'post',
data:{req:request,SCHED_ID:id},
dataType:'json',
success:function(data){
dp.events.load("schedules.php");
dp.message(data.msg);
}
});
}
});
} },
{text:"Move schedule", onclick: function() {
DayPilot.Modal.form(form).then(function(args){
//i made an empty form with some fields
});
}},
{text:"Cancel Reservation", onclick: function() {
DayPilot.Modal.confirm("Are you sure you want to cancel reservation?",{ okText: "Yes", cancelText: "No" }).then(function(args){
if(args.result == "OK"){
var request = 2;
$.ajax({
url:'ajaxScript.php',
type:'post',
data:{req:request,SCHED_ID:id},
dataType:'json',
success:function(data){
dp.events.load("schedules.php");
dp.message(data.msg);
}
});
}
});
}}
]});
}