Hello,
I’m building a planning using the timeline view and I made a lot of customization in it. Currently I’m trying to optimize a little bit because some functions are called a lot, which can be pretty laggy.I noticed that a lot of rendering functions (like timeline_scale_label to custom Y axis on timeline view) are called two times on first init page. Is there a reason ?
But my main problem is : it’s also called every time you make something in the planning. The thing is that I have images on my Y axis, using this function :
// Permet de personnaliser les cellules des ressources en axe Y
scheduler.templates.timeline_scale_label = function(key, label, section){
// Une ressource avec key "open" signifie qu'il s'agit d'un dossier
if(section.open === undefined) {
let avatar = section.avatar !== null ? section.avatar : "default.jpg";
let css = '<div class="container-scale-label" style="background-color:#' + section.couleur + ';">';
css += '<div><img src="images/ressources/' + avatar + '" alt="'+ label + '"/></div>';
css += '<div>' + label + '</div>';
css += '</div>';
return css;
}
else {
return "";
}
};
Which works fine. But because it’s called every time you update an event, add one, move something, it causes some “clipping”. In my project, this kind of function could be called only one time (initialization of the page). Is there some tricks to do this ? To be more specific : clipping problem happens when console is open (on Chrome), but question remains.
Thanks in advance