Created
May 16, 2018 03:42
-
-
Save marineko/21d36bc39842d88f8b9abf7cc1051185 to your computer and use it in GitHub Desktop.
Fix HTML in SharePoint Calculated columns
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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