I'm attempting to override the rendering of a Select column in a list web part that provides filter values to another list web part. In the code below, I'm attempting to not display the Selector icon for the list web part providing the filter values when the first 7 characters of the "Proficiency_x0020_Level" contain the value "Level 3". When that value is "Level 3", I want to display the text "NA". Otherwise, I would like to see the default selector icons displayed for the "Select" column.
In the code below, the logic for what to do when the value is "Level 3" works just fine. My problem is that I can't figure out how to return the default format (i.e., the selector icon and it's underlying link) for the "SelectTitle" column. When using CSR, how does one enable the default rendering of a field? Thanks!
(function () {
// Create an object that have the context information about the fields that we want to change the rendering of.
var SLevlFieldContext = {};
SLevlFieldContext.Templates = {};
SLevlFieldContext.Templates.Fields = {
// Apply the new rendering for these fields on List View
"SelectTitle": { "View": SLevlFieldTemplate}
};
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(SLevlFieldContext);
})();
// This function provides the rendering logic for the list view
function SLevlFieldTemplate(ctx) {
var _SLevlvalue = ctx.CurrentItem["Proficiency_x0020_Level"];
var _subSLevlvalue = _SLevlvalue.substring(0,7)
switch (_subSLevlvalue) {
case "Level 3":
return "<center>NA</center>";
break;
default:
return ctx.CurrentItem.SelectTitle;
break;
}
}
Added the screenshot below to illustrate the outcome I experienced attempting to use Abdul's recommendation of RenderFieldValueDefault(ctx)