Is there a way to make events invisible or maybe another way?
My problem is that the calendar always loads the whole events. When there is an event where he’s not able to refer the id he puts it in the first column. But i don’t want to display these events.
Then unfortunately there is no easy solution in this case.
You can try filtering events by checking their units_id (property to which units view is mapped to) and displayed units.
In some if your topics I showed how to filter events:
scheduler.filter_day = function(id, event){
if (some_condition)
return false; // event won't be displayed
return true; // event will be displayed
}
and how to get list of current options in units view:
scheduler._props.unit.options
Now what you need to do is to iterate through this array and check event’s map_to property value is matching at least one of the options.
There isn’t a point in the javascript where i simply can say “if whatever {load} else {don’t load}” ?
Where i have to call “scheduler.filter_day(id, event) {” ?
I still don’t understand “when” and “where” i am able to disable an event
You don’t need to call it, you need to define it. It later on will be used by scheduler to determine if each specific event should or should not be displayed.
Filter function it is.
Array which you used as list of options for units view.
OK … i understood you completely wrong. Now i got it. The only little problem i have is how can i see the “map_to” parameter of the “loaded sections”? If i understand it right, the events are shown in the first column because they don’t have the correct “map_to” parameter.
scheduler.filter_unit = function(id, event){
var A = scheduler._props.unit.options;
for (var i = 0; i < A.length; i++) {
if (event.type == A[i].type) <--- here is my problem because A[i].type is undefined
return true;
}
return false;
}
I also have to filter “day_tab / week_tab / month_tab / year_tab”. Except of “year_tab” it works fine. Where is my mistake?
scheduler.filter_year = function(id, event){
var A = scheduler._props.unit.options;
for (var i = 0; i < A.length; i++) {
if (event.type == A[i].key)
return true;
}
return false;
}
Thank you
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan