SMART datagrid v.1 > Classes > CheckBar

Back  Forward

DataLudi.CheckBar.checkAllCallback  property

When click CheckBar head cell, it will toggle Checked state of all rows, and if set this callback, this function will be called in each row to determine the checked state of rows only which have returned true

function (row: GridRow):Boolean;

First, checkableOnly should be false or Checkable of row should be true. If specify this callback function, checkAllExpression will be ignored. 

Defaults to null.

Getter
function checkAllCallback(): Function
Setter
function setCheckAllCallback(value: Function)
Code -1
    grid.setOptions({
        checkBar: {
            // Only toggle even rows.
            checkAllCallback: function (row) {
                return row.index() % 2 == 0;
            }
        }
    }
Code -2
    grid.setCheckBar({
        // Only toggle the rows which 'Quantity' is greater than 40.
        checkAllCallback: function (row) {
            return row.getValue('Quantity') >= 40;
        }
    });
See Also
GridBase.isChecked
GridBase.isCheckable
checkAllExpression
checkableOnly
GridBase.checkBar
Examples
Check Bar
Checkable Expression & Callback