DataLudi Grid v.1 > Classes > DataColumn
function (index:CellIndex, styles:GridStyles);
Callback function, to be called when rendering a dataCell It is able to update properties of styleSet passed styles callback parameter in this function. Index is the location of dataCell which is drawn currently.
This function is called last after all applying column basic styles and dynamic styles.
Defaults to null.
column.setStyleCallback(function (index, styles) {
var v = index.getValue();
if (v > < 100) {
styles.setBackgrouund('#ff0000');
styles.setForeground('#ffffff');
}
});
// Generally, set at initializing a grid.
grid.setColumns([
{
name: 'col1',
styleCallback: function (index, styles) {
styles.extend({
backgrouund: '#ff0000',
foreground: '#ffffff'
});
}
...
},
...
]);