I created a simple JSLink CSR test that should override the view in SharePoint when an individual list item is displayed.
The viewTemplate function is never called. Here is the JSLink JavaScript file. I walked through the code in debugger and I step through all the lines of code without an error.
SP.SOD.executeFunc("clienttemplates.js", "SPClientTemplates", function () {
// Create object that have the context information about the field that we want to change it's output render
var formTemplate = {};
formTemplate.Templates = {};
formTemplate.Templates.View = viewTemplate;
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(formTemplate);
});
function viewTemplate(ctx) {
var formTable = "";
formTable = "<div style='width:100%;float:left;padding:0 50px 15px 0;'>" +
"<h3>It worked</h3>" +
"</div>";
return formTable;
}
Thanks in advance. Hal.