I added a list view to a page. The List contain two columns "Title" and "ReleaseDate". The "Title" is the default column when I create the list. I have not changed the column name.
Here is part of my CSR js code. I call "ReleaseDateViewTemplate" for Title field by purpose. So that I can count how many "Hi" is returned.
overrideCtx.Templates.Fields = {
"Title": {
"View": ReleaseDateViewTemplate
},
"ReleaseDate": {
"View": ReleaseDateViewTemplate
}
};
function ReleaseDateViewTemplate(ctx)
{
alert("hi");
var date = ctx.CurrentItem[ctx.CurrentFieldSchema.Name];
var monthNames = [ "January", "February", "March", "April", "May", "June","July", "August", "September", "October", "November", "December" ];
var d = new Date(date);
return "<div class='dateBox'><div class='dayDateBox'>" + d.getDay() + "</div><div class='monthDateBox' >" + monthNames[d.getMonth()] + "</div></div>";
}
According to my experiment, the ReleaseDateViewTemplate function have not been rendered on the Title field. But it rendered for ReleaseDate field. Any advice to debug it? Thanks.