I’m loading events via XML and I’m setting the readonly attribute to 0 or 1 but the scheduler doesn’t seem to honor the readonly flag. Do I need to take som action after data loading, like looping through events and setting a flag?
XML example (I’m building the XML manually via C# and SQL Server based on your MVC tutorial):
Thanx, now it worked better but I have one problem left. The form is readonly but I can still move around events (and thus change date) even if they are marked as readonly.
Should I loop or perform an action on onBeforeDrag event or something to sovle this?
Great product btw. FYI I had to use readonly = “” and readonly = 1.
The below code performs that but I end up with a strange thing on drag-create of new events (which I want to allow).
scheduler.attachEvent("onBeforeDrag", check_readonly);
function check_readonly(id) {
var ev = scheduler.getEvent(id);
if (ev.readonly == true) {
return false; //dissalow drag-move on this event
}
else {
return true;
}
}
1.
When I drag-create a new event I never get the form popup. Instead the eventbar follows my mousepointer even after I let the mousebutton go.
If I remove the code above, I can drag-create events as normal.
If I on the other hand have moved an object just once, then drag-create works for new events.
But any time on first load, the drag-create doesn’t work.
I had to do a id == null check first to get this to work on new events. Below works.
scheduler.attachEvent("onBeforeDrag", check_readonly);
function check_readonly(id) {
if (id == null) { //true for new events on first site visit
return true;
}
else { //check readonly flag
var ev = scheduler.getEvent(id);
if (ev.readonly == true) {
return false; //disallow drag-move on this event
}
else {
return true; //allow drag-move
}
}
}
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan