Timeline update sections

Hi, I need to update the sections in my timeline but iterate and use addSection with a large list of sections it’s too slow.

I tried…

scheduler.matrix.timeline.y_unit = resultado.sections;
scheduler.callEvent("onOptionsLoad", []);    

and…

scheduler.updateCollection("y_unit", resultado.sections);

I don’t fully undestand the updateCollection method.

Please, how can I update the sections ??

Hi,
you need to use ‘updateCollection’ method. It should be used in pair with ‘scheduler.serverList’ method, i.e.

  1. you define y_unit as a named collection with initial values:scheduler.createTimelineView({ ... y_unit: scheduler.serverList("timeline_sections", []), ... });
  2. you can refer collection by a name given in ‘serverList’ method and update it: scheduler.updateCollection("timeline_sections", [...new sections...]);
    docs.dhtmlx.com/scheduler/api__s … rlist.html
    docs.dhtmlx.com/scheduler/api__s … ction.html

It worked ¡

Thank you very much.