SMART datagrid v.1 > Classes > CheckBar
Expression which determines Checkable state of Grid Rows.
When EditOptions.checkable is true, the user can click only the rows of which Checkable is true to change checked state. CheckBar cells of which rows are not Checkable will be displayed in inactive state.
If set checkableCallback, this property will be ignored. In the table below, it has listed the variables which can be used in this expression.
Defaults to null.
Variable | Explanation |
---|---|
'values' | Get the value as field name or field index of Fields. |
'row' | Index of row. |
'datarow' | Data Index of row. |
'checked' | Checked state of row. |
'state' | State of data row. DataRowState.CREATED: 'c', UPDATED: 'u', DELETED: 'd', CREATED_AND_DELETED: 'x' |
'count' | Number of child rows in the case of Group Row. |
'dcount' | Number of descendant rows in the case of Group Row. |
'tag' | Data tag |
// Can only check the rows of which salary is greater than 10000 dollars.
grid.checkBar().setCheckableExpression('values["fldSalary"] > 10000');
grid.setCheckBar({
'checkableExpression': 'values["fldSalary"] > 10000'
});
grid.setOptions({
checkBar: {
'checkableExpression': 'values["fldSalary"] > 10000'
}
});