SMART datagrid v.1 > Classes > GridBody

Back  Forward

DataLudi.GridBody.rowDynamicStyles  property

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. 

Getter
function rowDynamicStyles(): DynamicStyleCollection
Setter
function setRowDynamicStyles(value: Array|Object)
Note

The variables which can be used in expression of dynamic style are as below. 

Table-1  expression variables
VariableExplanation
'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.
Code -1
    grid.body().setRowDynamicStyles([{
        expression: "row % 2 == 1",
        styles: {
            background: "#000088",
            foreground: "#fff"
        }
    }]);
Code -2
    // It can also be loaded from GridBase.loadStyles.
    grid.loadStyles({
        body: {
            rowDynamic: [{
                expression: "row % 2 == 1",
                styles: {
                    background: "#000088",
                    foreground: "#fff"
                }
            }]
        }
    };
See Also
cellDynamicStyles
GridBase.loadStyles
DataColumn.dynamicStyles
Dynamic Styles Overview
Grid Style Overview
Examples
Row Dynamic Styles
Column Dynamic Styles
Default Dynamic Styles