SMART datagrid v.1 > Classes > ButtonCellRenderer

[ grids ver.1.2.9]   Back  Forward

DataLudi.ButtonCellRenderer.enabledExpression  property

Expression which returns enable, disable states of button. 

Only in the cell which returns true in the expression during run time, the button will become enable state. In the table below, it has listed variables which can be used in expression. 

If set enabledCallback, this property will be ignored. 

Defaults to null.

Getter
function enabledExpression(): String
Setter
function setEnabledExpression(value: String)
Table-1  ButtonCellRenderer.enabledExpression variables
VariableExplanation
valueThe field value.
rowThe number of grid row.
datarowThe number of data row.
fieldThe index of data field.
checkedIf grid row is checked state, it will be true.
stateThe State of data row.
Code -1
    var columns = [{
        name: "column1",
        renderer: {
            type: "button",
            enabledExpression : "value < 10"
        }
    },
    ...
    ];
    grid.setColumns(columns);
Code -2
    $("#changeExpression").click(function () {
        var col = grid.columnByName('column1');
        col.setRenderer({ 
            enabledExpression : "value < 10"
        });
    });
See Also
enabledCallback
Expression
imageUrl
disabledImageUrl
Examples
Image Button Renderer