After deploying a JSLink file to add a button to a list view, I'm getting the following error when expecting the page in Chrome developer tools.
using the following to reference the item
~sitecollection/Site Assets/JSLinkAddCommentToManagerButton.js
here is the code:
(function () {
document.write('<style type="text/css">.btn { background: #0072C6;
background-image: -webkit-linear-gradient(top, #0072C6, #2980b9);
background-image: -moz-linear-gradient(top, #0072C6, #2980b9); background-
image: -ms-linear-gradient(top, #0072C6, #2980b9); background-image: -o-
linear-gradient(top, #0072C6, #2980b9); background-image: linear-
gradient(to bottom, #0072C6, #2980b9); font-family: Arial; color: #ffffff; font-size: 12px; background: #0072C6; padding: 6px 10px 6px 10px; text-decoration: none; margin-right:10px;}<\/style>');
var statusFieldCtx = {};
statusFieldCtx.Templates = {};
statusFieldCtx.Templates.Fields = {
"Action": {
"View": ShowButton
}};
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(statusFieldCtx);
})();
function ShowButton(ctx) {
var _ItemId = ctx.CurrentItem.ID;
var TitleFeedback = "Send Comment to Manager";
var TaskView = "/teams/MTS/Engagement/Lists/ShoutWall/DispForm.aspx?ID="+_ItemId;
return "<a href='javascript:void(0)' onclick=\"openViewDialog('" + TaskView + "', '" + TitleFeedback + "')\" class='btn'>Add Comment</a>";
}
function openViewDialog(tUrl, tTitle) {
var options = {
url: tUrl,
title: tTitle,
height:600,
width:800,
dialogReturnValueCallback: function(dialogResult)
{
SP.UI.ModalDialog.RefreshPage(dialogResult)
}
};
SP.UI.ModalDialog.showModalDialog(options);
}