"is not a function" error on addSection

Hi,

I am currently evauluating dhtmlxScheduler to see if it would be suited to my company’s project. I have copied the example 06_timeline/02_lines.html and added a simple event handler to a button I’ve placed on the page to add a section to the scheduler.

The line of code I execute to do this is:
scheduler.addSection( {key: 5, label: “Test section” },null);

However when this code gets executed an exception is thrown with the error “addSection is not a function”.

I can see that the sample already includes the Javascript file ext/dhtmlxscheduler_timeline.js on the correct path so the function should be available.

Please can you tell me what it is I might be doing wrong?

Thanks,
James

Hello,

Do you use Tree-Timeline view ?

is for simple timeline view.

To update list of sections on timeline view you can use updateCollection (it’s not limited to timeline view and can be used with any collection).

Kind regards,
Ilya

Hi,

Thank you for your fast response. I did use a simple timeline view. Your suggestion of updateCollection has worked though.

Thanks,
James