Skip to content

Instantly share code, notes, and snippets.

@marineko

marineko/fixHTML.js

Created May 16, 2018
Embed
What would you like to do?
Fix HTML in SharePoint Calculated columns
(function () {
var htmlColumnContext = {};
htmlColumnContext.Templates = {};
htmlColumnContext.Templates.Fields = {
"field1": {
"View": field1ViewTemplate
},
"field2": {
"View": field2ViewTemplate
},
"field3": {
"View": field3ViewTemplate
}
};
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(htmlColumnContext);
})();
function field1ViewTemplate(ctx) {
var ret1 = ctx.CurrentItem["field1"];
return ret1;
}
function field2ViewTemplate(ctx) {
var ret2 = ctx.CurrentItem["field2"];
return ret2;
}
function field3ViewTemplate(ctx) {
var ret3 = ctx.CurrentItem["field3"];
return ret3;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.