I have a page with 2 views of same list. When I use the JSLink to render one of the column (request_id) which is present in both the views, in one view JSLink is working fine, but on the second view it is not working. Below is the code.
<script type="text/javascript">
(function () {
// Initialize the variable that stores the objects.
var overrideCtx = {};
overrideCtx.Templates = {};
overrideCtx.Templates.Fields = {
'Request_ID': {'View':ChangeStatusIcon}
};
// Register the template overrides.
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);
})();
function ChangeStatusIcon(ctx)
{
var AdminNo= ctx.CurrentItem.Admin_No;
var Auto = ctx.CurrentItem.Auto_x0023_;
var RequestDate= ctx.CurrentItem.Request_date;
var year = RequestDate.split("-");
var Current_Year = year[2];
var urltext="CLM_"+Current_Year+"_"+Auto;
var url= "/sites/SCL/Lists/Admin%202/Item/editifs.aspx?&ID="+AdminNo+"";
var coltxt="<a href="+url+" target='_self'>"+urltext+"</a>";
return coltxt;
}
</script>