0

Am doing some coding on JSlink to implement conditional formatting on SharePoint lists. We are using SharePoint 2013 online (office 365). The format of the given field(s) are changed based on other fields. The conditional formatting is working perfectly, when all the fields are shown on a list view. To make the list view pretty, I need to create new list view with fewer column, also I want to give the flexibility for the users to have other views if they wish.

The Problem:

Once I remove a fields from the list view, the value turned into ‘undefined’ which break all the fields formatting because they are related. (Make sense because am using client side rendering to do the conditional formatting).

The Question:

What is the best way to read/retrieve value of fields that are not part of the view using JavaScript?

The Code:

Am using the following code to retrieve data of fields.

var planD = ctx.CurrentItem.InternalName1;

var actualD = ctx.CurrentItem.InternalName2; // Once I remove this field from the list view it returns undefined

Looking forward to get help

Thanks

(Visited 89 times, 1 visits today)
Add a Comment