I want to apply the JSLink file to the field to render it differently.
<Field ID="{2F30125C-D2C9-459F-9AC5-1796F52C0C4B}"
Name="oiplbDepartment"
StaticName="oiplbDepartment"
Type="TaxonomyFieldType"
ShowField="Term1033"
EnforceUniqueValues="FALSE"
DisplayName="$Resources:OIPLBIntranet,fldoiplbDepartmentDisplayName;"
Description="$Resources:OIPLBIntranet,fldoiplbDepartmentDescription;"
Group="$Resources:OIPLBIntranet,grpFields;"
DisplaceOnUpgrade="TRUE"
JSLink="~siteCollection/Style%20Library/LofbergsIntranet/Scripts/SingleDepartment.js">
My jslink file code:
(function () {
var favoriteColorContext = {};
// You can provide templates for:
// View, DisplayForm, EditForm and NewForm
favoriteColorContext.Templates = {};
favoriteColorContext.Templates.Fields = {
"oiplbDepartment": {
"View": favoriteColorViewTemplate
}
};
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(
favoriteColorContext
);
})();
// The favoriteColorViewTemplate provides the rendering logic
// the custom field type when it is displayed in the view form.
function favoriteColorViewTemplate(ctx) {
var color = ctx.CurrentItem[ctx.CurrentFieldSchema.Name];
return "<h1>Hello</h1>";
}
I am not getting the field rendered differently. What am I missing?