Events invisible ?

Hello

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.

Thank you

Hello,

Are you talking about units view?
If so please check ‘Skipping events’ section in our Units view documentation.

Kind regards,
Ilya

This documentation is for Scheduler 3.0 but i am using 2.3 ?!

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.

Kind regards,
Ilya

hello

Can you guide me a little bit through the “expert” solution? Showing events which do not belong to any unit is a really big problem :frowning:

Thank you

Hello,

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.

Kind regards,
Ilya

oh damn :frowning: heavy code if you are new :frowning:

scheduler.filter_day = function(id, event){ <-- is a new function ??
scheduler._props.unit.options <-- this line i really don’t understand :frowning:

I’m sorry :frowning:

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 :frowning:

viewtopic.php?f=6&t=20819&p=66308&hilit=filter_#p66308
+
viewtopic.php?f=6&t=20831

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.

Kind regards,
Ilya

i really shame for this question but how can i see what is inside “scheduler._props.unit.options” ? How can i parse this options?

damn … i’m really sorry and really thankful that you help me all the day

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;
}

Change the problematic line as

if (event.type == A[i].key) 

oh shit :frowning: was a little bit too late yesterday … finally works fine :sunglasses:

Thank you

Hmm …

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