SMART datagrid v.1 > Examples

Back  Forward

Checakble Expression & Callback  Example

Basically, if EditOptions.checkable is true, the user can click the cells of Check Bar to change the checked state of the grid row. However, if use CheckBar.checkableExpression or checkableCallback, you can disable the user from changing the checked state of a specific row by mouse click. If set CheckBar.checkableOnly as false, checkableExpression and checkableCallback will be ignored. 

Code -1
    grid.editOptions().setCheckable(false);
    grid.checkBar().setCheckableOnly(false);

(EditOptions.checkable (Checkbar.checkableOnly

Grid - 1
rows

Enable to check only the modified rows through Checkable Expression. 

Remove Checkable Expression. 

Enable to check only the rows which "Interest Rate" is smaller than 4 through Checkable Callback. 

Remove Checkable Callback. 

If checkableCallback is set, checkableExpression will be ignored. The Check Bar cells of the rows which are not checkable will be displayed as inactive. 

Code -2
    grid.setCheckBar({
        checkableCallback: null,
        checkableExpression: 'state == "u"'
    })

View Source JSP 

See Also
CheckBar
CheckBar.checkableExpression
GridBase.checkableCallback
GridBase.onRowChecked
GridBase.onRowsChecked
Examples
Check Bar