alert("Hello");
(function () {
alert('starting')
var fieldCtx = {};
fieldCtx.Templates = {};
fieldCtx.Templates.Fields = {
"ShowOnDisplayBoard": //This is field name, make sure to enter the internal column name
{
"View": UpdateApprovalTempalte //Enter the function name
}
};
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(fieldCtx);
})();
var imgTrue = "<img src='/siteassets/checked.png' width='16px'/>"
var imgFalse = "<img src='/siteassets/uncheck.png' width='16px'/>"
function UpdateApprovalTempalte(ctx) {
var columnValue = ctx.CurrentItem.ShowOnDisplayBoard; // get the value of the ApprovalColumn field of the current item
var returnValue = "";
if (columnValue == 'Yes')
returnValue = imgTrue;
else if (columnValue == 'No')
returnValue = imgFalse;
else if (columnValue == '')
returnValue = imgFalse;
else
returnValue = columnValue;
return returnValue;
}
(function () {
alert('starting')
var fieldCtx = {};
fieldCtx.Templates = {};
fieldCtx.Templates.Fields = {
"ShowOnDisplayBoard": //This is field name, make sure to enter the internal column name
{
"View": UpdateApprovalTempalte //Enter the function name
}
};
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(fieldCtx);
})();
var imgTrue = "<img src='/siteassets/checked.png' width='16px'/>"
var imgFalse = "<img src='/siteassets/uncheck.png' width='16px'/>"
function UpdateApprovalTempalte(ctx) {
var columnValue = ctx.CurrentItem.ShowOnDisplayBoard; // get the value of the ApprovalColumn field of the current item
var returnValue = "";
if (columnValue == 'Yes')
returnValue = imgTrue;
else if (columnValue == 'No')
returnValue = imgFalse;
else if (columnValue == '')
returnValue = imgFalse;
else
returnValue = columnValue;
return returnValue;
}
No comments:
Post a Comment