Change formatting of Table Row based on field value

I’ve used this on a bunch of tab pages successfully. Is there any reason it wouldn’t work on a table on a detail page? If not I can’t see where I have gone wrong. I have tried with the field on the table and without. Same logic, highlight a row where a checkbox is marked as true. 

I’ve tried read/readonly. 

Snippet:

var field = arguments[0];var value1 = arguments[1];
var row = field.row;
var value2 = row.Flag__c;

skuid.ui.fieldRenderers[field.metadata.displaytype]field.mode

if ((field.mode == ‘readonly’) && (value2 === true))



field.item.element.addClass(“flag_highlighted-row”);

}

CSS:

table.nx-skootable-data tbody tr.flag_highlighted-row td {    
   background-color: #ffffcc;

}