1

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; // this field is not included on the new list view and returns undefined

Looking forward to get help

Thanks

  • Why can't you just keep the field in the view and hide it in the template? – Amal Hashim Jan 6 '15 at 17:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.