I found a few tutorials to do this, many of them point to using the jslink or content editor. I tried following the instructions in this site: CSR code samples #1 (Task Priority color) but it's not working for me.
I created a new list with the column called Priority, uploaded the js file into _catalogs/masterpage/displaytemplates and put the url (~site/_catalogs/masterpage/Display Templates/Text_Colour.js) into the JS Link field.
I didn't make any changes to the following code:
// List View – Priority Color Sample
// Muawiyah Shannak , @MuShannak
(function () {
// Create object that have the context information about the field that we want to change it's output render
var priorityFiledContext = {};
priorityFiledContext.Templates = {};
priorityFiledContext.Templates.Fields = {
// Apply the new rendering for Priority field on List View
"Priority": { "View": priorityFiledTemplate }
};
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(priorityFiledContext);
})();
// This function provides the rendering logic for list view
function priorityFiledTemplate(ctx) {
var priority = ctx.CurrentItem[ctx.CurrentFieldSchema.Name];
// Return html element with appropriate color based on priority value
switch (priority) {
case "(1) High":
return "<span style='color :#f00'>" + priority + "</span>";
break;
case "(2) Normal":
return "<span style='color :#ff6a00'>" + priority + "</span>";
break;
case "(3) Low":
return "<span style='color :#cab023'>" + priority + "</span>";
}
}
Is there any changes I need to make for this to work as expected?
I also tried added this script to the Script Editor web part and instead of running the script, it shows the text.
Is there something I need to add or setting I need to change to make this work?

