SMART datagrid v.1 > Classes > DynamicStyleImpl

Back  Forward

DataLudi.DynamicStyleImpl.callback  property

JavaScript callback function which determines whether to apply the style. 

function (scope:*):Boolean;

scope is different depending on the target in which apply this dynamic style. In general, in the case of applying to the data cell, they will become ValueCell objects like DataCell. The type of scope cell of each column type has been listed as below. 

Getter
function callback(): Function
Setter
function setCallback(value: Function)
scope
Note
Code -1
    grid.setColumns([{
        name: "category",
        fieldName: "category",
        width: 100,
        styles: { textAlignment: "far" },
        dynamicStyles: [{
            callback: function (scope) {
                return !scope.value() || !scope.value().match(/Damag/i);
            },
            styles: {
                "background": "#1100ff00"
            }
        }],
        header: { text: "Category" }
    },
    ...
    ]);
See Also
expression
DataColumn.dynamicStyles
GridBody.cellDynamicStyles
GridBody.rowDynamicStyles
DataCell
ValueCell
Examples
Column Dynamic Styles
DefaultDynamicStyles