addSection(section_object, parent_section_id)

Required library edition: This method works with any edition of DHTMLX library
Required library file: dhtmlxscheduler_treetimeline.js

adds section to specified parent section in current Timeline-Tree view.

  • section object
  • parent section id

Note: if section is added to the root then null should be specified as parent_section_id.

Returns true if section was added successfully and false in other cases, e.g. incorrect parent_section_id was specified.

For example, if Timeline-Tree view used the following snippet:

scheduler.createTimelineView({
        ...
	y_unit: [ 
		{key:10, label:"Web Testing Dep.", open: false, children: [
			{key:20, label:"Elizabeth Taylor"},
			{key:30, label:"Managers", open: false, children: [
				{key:40, label:"John Williams"},
				{key:50, label:"David Miller"}
			]},
			{key:60, label:"Linda Brown"},
			{key:70, label:"George Lucas"}
		]},
		{key:80, label:"Kate Moss"},
		{key:90, label:"Dian Fossey"}
	],
        ...
});

Then to add another section to Managers folder execute:

scheduler.addSection( {key: 100, label: "Alice Green" }, 30);