(function () { var overrideCtx = {}; overrideCtx.Templates = {}; overrideCtx.OnPostRender = [ HighlightRowOverride ]; overrideCtx.Templates.Fields={ "Colour":{"View":RenderColour}} SPClientTemplates.TemplateManager.RegisterTemplateOverrides (overrideCtx);})();function RenderColour(ctx) { var link = ctx.displayFormUrl + "&ID=" + ctx.CurrentItem.ID + "&source=" + encodeURIComponent(window.location.href); var text = "< a class='ms-core-suiteLink-a' href='" + link + "'>< img src='/_layouts/15/images/icgen.gif'>"; return text;}function HighlightRowOverride(inCtx) { 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 (row != null) { row.style.backgroundColor = listItem.Colour; } } inCtx.skipNextAnimation = true;}