Update timeline sections when date is changed

Hi,

I want to update the sections in the timeline view when the date is changed.

I have this event implemented, which notifies me when the date is change:

scheduler.attachEvent("onViewChange", function(mode, date){ ...do some... return true; })

But I don’t know what collection I shall update.

I’m creating the timeline using:

scheduler.createTimelineView({ \ name: "timeline", \ x_unit: "hour", \ x_date: "%H", \ x_step: 1, \ x_size: ' + size + ', \ x_start: ' + start + ', \ x_length: ' + 24 + ', \ y_unit: scheduler.serverList("timeline_sections", sections), \ y_property: "section_id", \ section_autoheight: false, \ render: "bar", \ dy: 25 \ });

And on the event, when I want to change the sections I tried this:

scheduler.updateCollection("y_unit", scheduler.serverList("timeline_sections", [{key: 1, label: "John"}, {key: 2, label: "Adam"}, {key: 3, label: "Diane"}]));

, or this:

scheduler.updateCollection("timeline_sections", scheduler.serverList("timeline_sections", [{key: 1, label: "John"}, {key: 2, label: "Adam"}, {key: 3, label: "Diane"}]));

, or this:

scheduler.updateCollection("sections", scheduler.serverList("sections", [{key: 1, label: "John"}, {key: 2, label: "Adam"}, {key: 3, label: "Diane"}]));

, but the sections in timeline ar not changing.

What am I doing wrong?

Thanks!
Bogdan.

name of collection is equal to the name of server list, so after

y_unit: scheduler.serverList(“timeline_sections”, sections), \

it must be

scheduler.updateCollection("timeline_sections", [{key: 1, label: "John"}, {key: 2, label: "Adam"}, {key: 3, label: "Diane"}]);

Thanks a lot! It works! This is really helpful!