I want to make all my past events and events with Booked and Reserved status as Readonly & shouldn’t be Dragged/Changed/Resized/Moved but the rest of the events should be editable and can be Dragged/Changed/Resized/Moved. Moreover Repeat event section should be visible for new events and events that don’t have Booked and Reserved status.
[code]scheduler.attachEvent(‘onBeforeDrag’, function(event_id, mode, native_event_object){
if (event_id == null) return true;
if(mode != 'create')
{
var ev = scheduler.getEvent(event_id);
var Level2_Fields = 'statusname';
var Level2_Filter = "eventid = '" + ev.activityid + "'" + " and objectid = 1136012";
var Level2RSetIsSame = level23_find(false,'',gAppID,2,Level2_Fields,Level2_Filter, '', 0, 1, '', '');
if(ev)
{
if(ev.status == Level2RSetIsSame.getfieldbyname(1, 'statusname'))
{
if(ev.status == 'Booked' || ev.status == 'Reserved' || (ev.start_date.valueOf() < (new Date().valueOf())))
{
return false;
}
return true;
}
else
{
alert('This slot has been changed. You are currently viewing old data. Your page will now refresh.');
getEventData();
return false;
}
}
}
return true;
});[/code]