As the title says, my code for the JSLink is not working on my list for non admins. I made sure that the script was published as a major version and it is still not working. My code is:
(function () {
console.log("Started");
var overrideCtx = {};
overrideCtx.Templates = {};
overrideCtx.Templates.Fields = {
'Title': { 'View': updateName}
};
function updateName(ctx) {
console.log(ctx.CurrentItem);
var base_url = "https://blah.sharepoint.com";
var file_path;
if (ctx.CurrentItem.File_x0020_Type === "pdf") {
file_path = base_url + ctx.CurrentItem.FileRef;
}
else {
file_path = ctx.CurrentItem.ServerRedirectedEmbedUrl;
}
var title;
if (ctx.CurrentItem.Title === "") {
title = ctx.CurrentItem.FileLeafRef;
}
else {
title = ctx.CurrentItem.Title;
}
return "<a href='" + file_path + "' style='color:#000000;'> " + title + "</a>";
}
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);
})();
One odd thing I noticed is that if I refresh the page with the developer console open (IE 9), then the JSLink works. Any suggestions?
Thanks!