SMART datagrid v.1 > Classes > CheckBar

Back  Forward

DataLudi.CheckBar.checkAllExpression  property

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.

Getter
function checkAllExpression(): String
Setter
function setCheckAllExpression(value: String)
Table-1  CheckBar.checkAllExpression variables
VariableExplanation
'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
Code -1
    grid.setOptions({
        checkBar: {
            // Only toggle even rows.
            checkAllExpression: "row % 2 == 0"
        }
    }
Code -2
    grid.setCheckBar({
        // Only toggle the rows which 'Quantity' is greater than 40.
        checkAllExpression: "values['Quantity'] >= 40";
        }
    });
See Also
GridBase.isChecked
GridBase.isCheckable
checkAllCallback
checkableOnly
GridBase.checkBar
Examples
Check Bar
Checkable Expression & Callback