SMART datagrid v.1 > Classes > DynamicStyleCase

Back  Forward

DataLudi.DynamicStyleCase.styles  property

The list of styles. 

If pass the judgment which has been specified by callbacks or expressions, the properties which have been specified in this list will be reflected. If do not specify styles in the corresponding location of each item in callbacks or expressions, it will use the style set which has been set before. 

Getter
function styles(): [Object]
Setter
function setStyles(value: [Object])
Code -1
    var columns = [{
        name: 'colQty',
        fieldName: 'quantity',
        dynamicStyles:[{
            expressions: [
                "row % 5 == 0",
                "row % 3 == 0"
            ],
            styles: [{
                shapeSize: size1,
                numberFormat: fmt1
            }, {
                shapeSize: size2,
                numberFormat: fmt2
            }]
        }]
    }, {
        callbacks: [
            function (cell) {
                return cell.rowIndex() % 5 == 0;
            },
            function (cell) {
                return cell.rowIndex() % 3 == 0;
            }
        ],
        styles: [{
            shapeSize: size1,
            numberFormat: fmt1
        }, {
            shapeSize: size2,
            numberFormat: fmt2
        }]
    },
    ...
    ];
    grid.setColumns(columns);
See Also
callbacks
expressions
GridBody.dynamicStyles
DataColumn.dynamicStyles
Examples
Column Dynamic Styles
DefaultDynamicStyles