I want to change the background color of the cells in a table dynamically based on the value in cell.
I found this example which I tried to modify according to my requirement but I was not successful in add or overriding CSS
var $ = skuid.$;var field = arguments[0];
var value = arguments[1];
switch( field.mode ){
case ‘edit’:
skuid.ui.fieldRenderersrfield.metadata.displaytype].edit( field, value );
break;
case 'read':
case 'readonly':
var cellElem = field.element;
var iconElem =
$( '<div>' )
.addClass('ui-silk')
.appendTo( cellElem );
switch( value )
{
case 'Value 1':
iconElem.addClass('ui-silk-flag-red');
break;
case 'Value 2':
iconElem.addClass('ui-silk-flag-orange');
break;
case 'Value 3':
iconElem.addClass('ui-silk-flag-green');
break;
default:
iconElem.addClass('ui-silk-sport-8ball');
break;
}
break;
}
Can anyone suggest what we can do in such scenarios?
-Thanks,
Charles M