Events coloring respect to linked tree nodes

Hi All,

There are two frames.One of which consist of tree view and the another consist of scheduler.We can save events respect to any nodes.Suppose there are two nodes n1 and n2 and there are two events e1 and e2 linked with n1 and n2 respectively.We generate random color if we checked a node.Then we pass the color in scheduler.js.When we checked a node we can see the created event respect to that node in the scheduler.Again if we checked another node then scheduler brings all the events(events of 1st node and events of 2nd node) and so on.

In our project we can see the first checked nodes events in the color of Ist node.But when we checked second node all the events getting the color of last checked node,because the scheduler load not just the 2nd node’s events but load all the events.

We want to see the events in different color respect to their linked node.

Thanks,
Nabonita




You can use event_class template to define rule, which css class need to be applied to the item based on some event’s property.

samples\02_customization\01_events_coloring.html

thanks for your reply.

Is it possible to restrict scheduler to stop reloading all events every time…
suppose event1 is already displayed.Now if i click a tree node then event2 is suppose to come with event1.Scheduler reload event2 as well as event1 also…Can we load event2 only for displaying event1 and event2…

It possible to use different strategy - load all events at once, and instead of reloading data, just filter existing events, based on selection in the tree.

Starting from version 2.0, scheduler has ability to filter self, it just not documented.
If you interested - I can provide details, how it can be used.

Yes i am interested. Can you please provide us with the details. Its very urgent.

You can define method

scheduler.filter_week = function(id, obj){ if (some_check(obj)) return true; return false; };

where some_check - method which receives event object and return true if event need to be shown. In you case it will check is event has some property which is selected in tree or not.

To apply filter - just refresh view

scheduler.setCurrentView(scheduler._date);

Thanks for your reply…

But we don’t have any method like some_check(obj)
From where I have to call scheduler.filter_week in scheduler.js…
So please provide these methods that all we need and some description also. :slight_smile:

You need not call the filter_ method - you need to define it once. Method will be called automatically each time when scheduler repaints itself.

some_check(obj) - need to be replaced with name of your custom method, which must validate is events need to be shown according to the current selection in tree, or not.