SMART datagrid v.1 > Classes > DataColumn
Dynamic Style Collection which is applied when rendering data cells involved in this column.
After applying GridBody.rowDynamicStyles, cellDynamicStyles, it will apply this dynamic style.
Defaults to null.
The variables which can be used in expression of dynamic style are as below.
Variable | Explanation |
---|---|
'value' | The value of data cell. |
'row' | index of grid row including the cell. |
'datarow' | dataIndex of grid row including the cell. |
'field' | index of data field connected to the cell. |
'checked' | If grid row is in checked state, it will be true. |
'state' | Data State of grid row including the cell. 'c': Creating, 'u': Updating, 'd': Deleting, 'x': Deleting after Creating |
'tag' | tag of cell column. |
column.setDynamicStyles([{
expression: 'value > 100',
styles: {
background: '#880000',
foreground: '#ffffff'
}
}, {
expression: 'value > 50',
styles: {
background: '#440000',
foreground: '#ffffff'
}
}]);
// or, when set the column in grid
grid.setColumns([{
name: 'col01',
dynamicStyles: [{
expression: 'value > 100',
styles: {
background: '#880000',
foreground: '#ffffff'
}
}, {
...
}]);