SMART datagrid v.1 > Classes > ButtonCellRenderer
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.
Variable | Explanation |
---|---|
value | The field value. |
row | The number of grid row. |
datarow | The number of data row. |
field | The index of data field. |
checked | If grid row is checked state, it will be true. |
state | The State of data row. |
var columns = [{
name: "column1",
renderer: {
type: "button",
enabledExpression : "value < 10"
}
},
...
];
grid.setColumns(columns);
$("#changeExpression").click(function () {
var col = grid.columnByName('column1');
col.setRenderer({
enabledExpression : "value < 10"
});
});