SharePoint: Format status column using JSLink

You might have seen the Out of the box SharePoint list view web parts showing customized column formatting for fields like status, priority and approval etc. The old way was to write a custom xslt template for the list view which can be used on list view properties to show customize output. This require too much custom effort and can risk your existing functionality.

There is another way to customize the list view web parts by simple script commands using JSlink, below I am sharing the code for a simple JSLink file which can be used for formatting the list column output.

Below are the steps to add a JSlink file to list view web part.

  1. Edit the list view page, this will show the list web part in edit able mode.
  2. Open the web part properties for list view web part.
  3. Scroll down and expand the Miscellaneous node and enter the url of JSLink file as shown in below screenshot

jslink edit web part

  1. Press Ok to save the changes, and then save changes on the page and you can see output similar to below screenshot which showing different color codes status field.

JSlink column formatting

You can also add image icons instead of color code by modifying the JSlink script.

The following two tabs change content below.
Adnan Amin
Adnan is two time SharePoint MVP (Most Valuable Professional) with over 12 years of extensive experience with major expertise on SharePoint Server, Office 365, .Net Platform and Microsoft BI. He is currently working SharePoint Architect at FMT Consultants. He is MCT Regional Lead for Pakistan Chapter since 2012. He is working on SharePoint for past nine years and worked on different intranet/intranet solutions for private & govt. sector majorly in Gulf region, which include OOB and customized solutions. He is a trainer, technology evangelist and also speaks in community forums.

Leave a Reply