Tell me how to set the default display of an element? Didn't find any good example anywhere on how to return the style and value of a list item to its default?
(function () {
var linkFilenameFiledContext = {};
linkFilenameFiledContext.Templates = {};
linkFilenameFiledContext.Templates.Fields = {
"LinkFilename": { "View": linkFilenameFiledTemplate }
};
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(linkFilenameFiledContext);
})();
function linkFilenameFiledTemplate(ctx) {
var fileRef = ctx.CurrentItem.FileRef;
var encoded = encodeURIComponent(fileRef);
var url = "http://sp-test/sites/test";
var FileLeafRef = ctx.CurrentItem.FileLeafRef;
var type = ctx.CurrentItem.File_x0020_Type;
var LinkFilename = ctx.LinkFilename;
var Project = ctx.CurrentItem.Project;
if(Project == "Active" && ctx.CurrentItem.File_x0020_Type == ""){
return "<b><span><a href=" + url + encoded + ">" + FileLeafRef + "</a></span></b>";
} else {
return //value and item style default?????
}
}