SMART datagrid v.1 > Classes > GridBody
Dynamic Style Set which is equally applied to all cells included in Grid Row.
You can specify one dynamic style setting object or specify as array. When rendering grid, the property values are determined once in each row. It is applied earlier than other dynamic style.
The variables which can be used in expression of dynamic style are as below.
Variable | Explanation |
---|---|
'values' | The value of each field cell included in grid row. ex) values['field_name'] |
'row' | index of grid row. |
'datarow' | dataIndex of grid row. |
'checked' | If grid row is in Checked state, it will be true. |
'state' | Data State of grid row including cell. 'c': Creating, 'u': Updating, 'd': Deleting, 'x': Deleting after Creating |
'tag' | Data Tag of grid row. |
'count' | The Number of child rows just below when it is group row. |
'dcount' | The Number of all descendant rows when it is group row. |
grid.body().setRowDynamicStyles([{
expression: "row % 2 == 1",
styles: {
background: "#000088",
foreground: "#fff"
}
}]);
// It can also be loaded from GridBase.loadStyles.
grid.loadStyles({
body: {
rowDynamic: [{
expression: "row % 2 == 1",
styles: {
background: "#000088",
foreground: "#fff"
}
}]
}
};