I’am still stuck in my unit view…
I am looking for the template to create to customize the header column in the unit view.
I would like to add an icon in the header next to the label.
I have done this successfully in the timeline view so it would be gret to be able to do the same in the unit view.
But in the templates documentation pages I don’t see anything for the unit view.
As you state in the other post where I talk about the unit view, it seems to me that I need to use the week_scale_date to do this. But the parameters is a date, so how can i do the link to my ressource in this case (I think I must test first the _mode to see if I am in the unit view or the week view, but after I don’t know how to make the link to my ressources (perhaps by _props in the scheduler ?)
Thanks in advance
There is no simple way to customize the header, except of unit_scale_date, which will require some calculation to receive label of the column.
Something like next
scheduler.createUnitsView({
name:"unit",
property:"section_id",
list:sections
});
scheduler.templates.unit_scale_date = function(date){
var name = "unit";
var list = scheduler._props[name].options;
var index = (scheduler._props[name].position||0)+Math.floor((scheduler._correct_shift(date.valueOf(),1)-scheduler._min_date.valueOf())/(60*60*24*1000));
//options not loaded yet
if (!list.length) return "";
return "+++"+list[index].label;
}