SMART datagrid v.1 > Classes > CheckBar
When click CheckBar head cell, it will toggle Checked state of all rows, and if set this expression, this expression will be called in each row to determine only the checked state of rows only which have returned true.
First, checkableOnly should be false or Checkable of row should be true. If set [[#.checkAllCallback], 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. The value returned by DataSet.getRowState. |
'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 |
grid.setOptions({
checkBar: {
// Only toggle even rows.
checkAllExpression: "row % 2 == 0"
}
}
grid.setCheckBar({
// Only toggle the rows which 'Quantity' is greater than 40.
checkAllExpression: "values['Quantity'] >= 40";
}
});