I need a script to highlight rows in a SP 2013 List if one field is null/empty.
Any help is appreciated!
Field: [Date Funded]
Thanks-
I need a script to highlight rows in a SP 2013 List if one field is null/empty.
Any help is appreciated!
Field: [Date Funded]
Thanks-
You can use Client side rendering/JS Link to highlight row based on column value. Similar to my answer given here.
Try something like below:
SP.SOD.executeFunc("clienttemplates.js",
"SPClientTemplates", function() {
SPClientTemplates.TemplateManager.
RegisterTemplateOverrides({
OnPostRender: function(ctx) {
var rows = ctx.ListData.Row;
for (var i=0;i<rows.length;i++)
{
var dateFunded = rows[i]["DateFunded"]; // use internal name of your column here
var rowId = GenerateIIDForListItem(ctx, rows[i]);
var row = document.getElementById(rowId);
if(!dateFunded) {
row.style.backgroundColor = "#FF0000"; //Red color
}
}
}
});
});
Reference: