I just started using JSLink, and i think it's great! But now i'm facing a problem with the following...
I have a DocLib where i want to display the Description field beneath the Title field. This works, but i need to include the actual column in the view to make it work. So now i have a view where the description is showing twice...
this is my code:
(function () {
var overrideCtx = {};
overrideCtx.Templates = {};
overrideCtx.Templates.Fields = {
'Title': { 'View': ShowDesc }
};
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);
})();
function ShowDesc(ctx) {
debugger;
var fieldVal = ctx.CurrentItem.Title;
var descVal = ctx.CurrentItem["Description0"];
var fileRefVal = ctx.CurrentItem["FileRef"];
var html = "<a href='" + fileRefVal + "' target='_blank'>" + fieldVal + "</a>";
html += "<br/>" + descVal;
return html;
}
How can i hide this field/column in my view and still show the description beneath the title?
Thanks in advance!!!