Tree View Parent & Child Folder Background Colors

Hi,

is there a way in which I can individually set the background color of parent and child folders when rendering in ‘tree’ mode - based on the folder key or label, in a similar way to using timeline_scaley_class when rendering in ‘bar’ mode.

In ‘bar’ mode, I append the class by:

scheduler.templates.timeline_scaly_class = function(key, label,  section){ 
			var css = "";
			if(section.key) 									
				css += "section_"+ section.key; 					
			if(section.id == scheduler.getState().select_id){
			}
			return css; // default return
			};

and then style accordingly using css like:

.section_1
     {
     background:#FFFFFF;
     color:white;
     border-top: 1px solid blue;
     border-bottom: 1px solid blue;
     }
.section_2
     {
     background: #FFFFFF;
     color:white;
     border-top: 1px solid blue;
     border-bottom: 1px solid blue;
     }

Is there a template for tree mode?

Is there a tree mode equivalents for:

  • scheduler.templates.timeline_scaley_class?
  • scheduler.templates.timeline_scale_label?
  • scheduler.templates.timeline_cell_class?
  • scheduler.templates.event_bar_text?

For the life of me, I can’t figure out how to achieve the same (or similar) style control in tree mode.

Please help.

Hello,
i’ve checked the sources and it seems that tree-timeline mode does not call timeline_scaly_class template, but the rest of templates (timeline_scale_label, scheduler.templates.timeline_cell_class, scheduler.templates.event_bar_text) should work exactly the same way in treetimeline as in regular timeline view.

docs.dhtmlx.com/scheduler/snippet/85e37375 - see the console for template calls.

Regarding the timeline_scaley_class template - i can’t see any particular reason why it is done that way, and most probably we’ll change it in the next version so the template will work in all modes of timeline.
If you PM me your license number I can send you an updated version of treetimeline extension.

Thanks for checking Aliaksandr: I spent a few more hours searching around but eventually concluded that timeline_scaley_class must not be called in tree timeline mode.

Needing to move forward, we amended the design requirements to reflect the scheduler library limitation.

Appreciate your confirmation though and look forward to exploiting it in the next version update.