Customizing SharePoint 2013 OOTB List view using JSLink

JSLink in SharePoint 2013 is a nice and only way to keep all the power of OOTB list view Web Part and add your own customizations. Here’s a simple example of highlighting an item row based on a column value.

(function () {
 var context = {};
 context.Templates = {};

 context.OnPostRender = [HighlightRowOverride];


function HighlightRowOverride(context) {

 for (var i = 0; i < context.ListData.Row.length; i++) {
 var listItem = context.ListData.Row[i];

 if (listItem["_Status"] == "Change requested") {
 var iid = GenerateIIDForListItem(context, listItem);
 var row = document.getElementById(iid);

 if (row.length != 0) {



Below is an example of an another customized list view Web Part, the grey table has been added through JSLink.

Pritam Baldota has explained in his MSDN Magazine article different ways of deploying and adding JSLink scripts the list view Web Parts.

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: