Hello
A few time ago i saw a code-line how to make events non-clickable but i don’t find it anymore
How can i set a readonly mode on specialized events? I just want to show these events but you shouldn’t be able to edit them.
Thank you
Hello
A few time ago i saw a code-line how to make events non-clickable but i don’t find it anymore
How can i set a readonly mode on specialized events? I just want to show these events but you shouldn’t be able to edit them.
Thank you
There is the readonly extension, which can be used for such event, or you can use onclick event like
scheduler.attachEvent("onClick", function(id){
if (scheduler.getEvent(id).readonly) return false;
return true;
});
Thank you
Works fine for “onClick” - “onDblClick” - “onBeforeDrag” because i just want to show this event without any action.
The only thing is i also want to disable the handcursor when an event is in readonly mode? Is there a possibility?
You can use templates and assign custom css to events with readonly property. Such css can change cursor as well as any other styles.
ok … thank you
hey … there’s still a problem For a special group of events i disabled “clicking”, “double-clicking” and “moving”. Everything worked fine until i click to create a new event. After i do that (clicking in a free space and close the lightbox) i’m not able to move any event and i’m not able to create a new event anymore. The only thing what still works is “single-click”.
Like this i proove if the event is readonly or not. And i think exactly here is the problem because the ID is overwritten ?!
scheduler.attachEvent("onClick", function(id){
if (scheduler.getEvent(id).readonly) return false;
return true;
});
scheduler.attachEvent("onDblClick", function(id){
if (scheduler.getEvent(id).readonly) return false;
return true;
});
scheduler.attachEvent("onBeforeDrag", function(id){
if (scheduler.getEvent(id).readonly) return false;
return true;
});
In this function i set the readonly mode:
scheduler.filter_unit = function(id, event){
var A = scheduler._props.unit.options;
// in this function i set the readonly status
sk_pruefe_abwesenheit(id);
for (var i = 0; i < A.length; i++) {
if (event.type == A[i].key)
return true;
}
return false;
}
Function where i set the readonly status:
sk_pruefe_abwesenheit = function(A){
.
.
.
xmlHttp.onreadystatechange = function () {
if (xmlHttp.readyState == 4) {
var B = xmlHttp.responseText;
if (B == "5") {
scheduler.getEvent(A).readonly = true;
} else {
scheduler.getEvent(A).readonly = false;
}
}
}
.
.
.
Beware that scheduler.filter_unit will be called each time when unit view is shown or repainted - it is quite expensive to make ajax call for each repainting.
Problem can be in onBeforeDrag, try to change it as
scheduler.attachEvent(“onBeforeDrag”, function(id){
if (id && scheduler.getEvent(id).readonly) return false;
return true;
});
onBeforeDrag occurs in the case when you are dragging mouse to create a new event - in such case id parameter will be empty.
works perfect
I have another possibillity to set the readonly mode? I noticed that the “filter_unit” function is calling really often … maybe too often …
Thank you
You can use onEventLoading handler to process event’s data just after loading.
Also, why not load readonly data directly as part of dataset, instead of separate ajax calls ?
I do but the user is also able to create events which are not movable. “onEventLoading” was a really good tip … i will change it.
Thank you
Hi
How to disable scheduler double click event for previous dates?
I dont want to create a new event for previous dates.
Thanks,
Hello,
Be sure to check scheduler\samples\03_extensions\16_limitation.html sample.
Kind regards,
Ilya