Hi I have a view where I'm grouping the list based on two columns and I would like to add some CSS to the cells containing "Green", "Red" etc.
I have created a JS method colorCoding
which takes care of coloring the cell containing the desired words.
I am calling the color coding method like this in my code
SP.SOD.executeFunc("clienttemplates.js", "SPClientTemplates", function() {
SPClientTemplates.TemplateManager.RegisterTemplateOverrides({
OnPreRender: function(ctx) {
console.log("calling color coding inside OnPreRender");
colorCoding();
console.log("color coding called inside OnPreRender");
},// close OnPostRender
OnPostRender: function(ctx) {
console.log("calling color coding inside OnPostRender");
colorCoding();
console.log("color coding called inside OnPostRender");
}// close OnPostRender
});// close RegisterTemplateOverrides
}); // close executeFunc
It worked very well on the view when there was no grouping. But started to fail once I applied grouping to the list view. On sorting or filtering any of the columns the color coding is called as expected. I need OnPostRender
to be called on expanding a group. It looks like OnPostRender
is not called on expanding a group.