Help with angular directive

Hi,

I found this page dhtmlx.com/blog/?p=2060 indicated how to implement the scheduler into angular directive. I would like to ask if there’s a way to implement the Unit view using this directive?

Thanks in advance.

The straight approach will be to add the unit view initialization code just before scheduler.init in the code of angular directive.

To make it more angular like, it possible to add $scope.$watch on the collection of units. when it is changed, code can call udpateCollection method of the scheduler to refresh list of units.

thank you, one more question is it posible to customize the column of each unit? like change the color of header or having color coding of each units?

You can define template for the content of unit ( unit_scale_text ), and return from it a custom html with necessary styling
docs.dhtmlx.com/scheduler/units_ … lates.html

As for events itself, you can use event_class template to color events based on related unit.

how to implement this code, i want to customize the color of each unit.

function(key, label, unit) { if (option.css) { return "<span class='" + option.css + "'>" + label + "</span>"; } else { return label; } };

Where exactly part of the code should i paste this? Can I use external js file and paste this code?
thanks for the reply.

You can place it after createUnitsView command, like next

scheduler.templates.unit_scale_text = function(key, label, unit) { if (option.css) { return "<span class='" + unit.css + "'>" + label + "</span>"; } else { return label; } };