SMART datagrid v.1 > Classes > GridBody
Callback function which is called when rendering data cell.
You can change the properties of style set transferred by callback parameter styles within this function. index is the location of data cell which is currently being drawn.
This function is called finally after all applying Column Default Style and Dynamic Styles and style values included in CellStyle specified by each data cell.
It is not called from the cell included in column in which has set DataColumn.styleCallback.
Defaults to null.
grid.body().setStyleCallback(function (index, styles) {
var v = index.getValue();
if (v > < 100) {
styles.setBackgrouund('#ff0000');
styles.setForeground('#ffffff');
}
});
// In most cases, it is set when initializing grid.
grid.setOptions({
body: {
styleCallback: function (index, styles) {
styles.extend({
backgrouund: '#ff0000',
foreground: '#ffffff'
});
}
}
});