Before i show my code, let me give some background. I am using JSLink in the webpart of the list. I have MDS disabled for the site. my javascript file is located in my root sitecollection in Style library.
this list works correctly at first but when filtered it looses the color until the list is refreshed. I have tried the skipanimation line as well, and it did nothing.
(function () {
var overrideCtx = {};
overrideCtx.Templates = {};
overrideCtx.OnPostRender = [
HighlightRowOverride
];
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);
}) ();
function HighlightRowOverride (inCtx) {
// for each item (row)
for (var i = 0; i < inCtx.ListData.Row.length; ++i) {
var listItem = inCtx.ListData.Row [i];
var iid = GenerateIIDForListItem(inCtx, listItem);
var row = document.getElementById(iid);
if (listItem.Status == "Stale") {
if (row != null) {
row.style.backgroundColor = "rgba(255, 0, 0, 0.5)"; //red
}
}
}
}