Help with field renderer -- checking for null lookup field

I've built a custom field renderer. I want to render table rows as red when the field mode is read only and value2 is not equal to null. Value2 is a lookup field.

I've tried both of these:

if (field.mode == 'readonly' && value2 !== null) 

if (field.mode == 'readonly' && value2 !== '') 


Currently, here's my snippet -- it's showing all rows as red


var field = arguments[0];

var row = field.row;

var value2 = row.Termination__c;

var value = skuid.utils.decodeHTML(arguments[1]); 


skuid.ui.fieldRenderers[field.metadata.displaytype][field.mode](field,value); 


if (field.mode == 'readonly' && value2 !== null) 

  { 

    field.item.element.addClass("UpdateForm_row-red");

  }

Sign In or Register to comment.