Delete all sections in (tree) timeline view

What is the best approach to delete all sections in the (tree) timeline view?

I see that the method deleteSection(section_id) is available, but than I need to remember all section_ids. Is there a way to delete all sections at one? Or, if not, is there a way to loop thru the sections and get the section_ids?


You are creating tree timeline view using an array with section ids. To get list of all ids you can, for example, parse it and store in some other variable. And then delete all sections in a loop using that list.

Or you can add new function:

scheduler.deleteAllSections = function(){ if(scheduler._isRender("tree")) { scheduler.matrix[scheduler._mode].y_unit_original = []; scheduler.matrix[scheduler._mode].y_unit = scheduler._getArrayToDisplay(scheduler.matrix[scheduler._mode].y_unit_original); scheduler.callEvent("onOptionsLoad",[]); } };
Best regards,

I implemented your deleteAllSections function. Works great!