SMART datagrid v.1 > Classes > ValueColumn
Callback function which is called at the point of rendering data cell.
You can change the properties of style set which is transferred by callback parameter styles within this function. index is the location of data cell which is being rendered now.
This function will be called at last after all applying style values included in Column Default Styles, Dynamic Styles and CellStyle specified in each data cell.
You can specify the default callback of all columns through GridBody.styleCallback(v 1.3.6). If specify column callback, it will not call the callback of GridBody.
Defaults to null.
column.setStyleCallback(function (index, styles) {
var v = index.getValue();
if (v > < 100) {
styles.setBackgrouund('#ff0000');
styles.setForeground('#ffffff');
}
});
// In most cases, it will be set when initializing grid.
grid.setColumns([
{
name: 'col1',
styleCallback: function (index, styles) {
styles.extend({
backgrouund: '#ff0000',
foreground: '#ffffff'
});
}
...
}, ...
]);