Ragi Burhum
By: a guest | Feb 9th, 2010 | Syntax:
JavaScript | Size: 0.85 KB | Hits: 32 | Expires: Never
{header: "Color", sortable: false, dataIndex: 'colorhex',
renderer: function(value, metaData, record, rowIndex, colIndex, store) {
//if (value == 'whatever') {
//metaData.css : String : A CSS class name to add to the TD element of the cell.
//metaData.attr : String : An html attribute definition string to apply to
// the data container element within the table
// cell (e.g. 'style="color:red;"').
//metaData.css = 'name-of-css-class-you-will-define';
//}
var newStyle = 'style="color:' + value + ';"';
metaData.attr = newStyle;//'style="color:red;"';
return "■";//value;
}
},
{header: "Name", width: 200, sortable: true, dataIndex: 'name'},