mardi 6 janvier 2015

Read field data of hidden column, sharepoint 2013



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








0 commentaires:

Enregistrer un commentaire