CheckColumn
A column that displays a checkbox in the cell. The value of the backing field is toggled by the checkbox.
Toggling of the checkboxes is disabled if a record is readOnly or if the CellEdit feature is not enabled.
This column renders a Checkbox into each cell, and it is not intended to be changed. If you want to hide certain checkboxes, you can use the renderer method to access the checkbox widget as it is being rendered.
new Grid({
appendTo : document.body,
columns : [
{
type: 'check',
field: 'allow',
// In the column renderer, we get access to the record and CheckBox widget
renderer({ record, widgets }) {
// Hide checkboxes in certain rows
widgets[0].hidden = record.readOnly;
}
}
]
});
Useful configs
| Config | Description |
|---|---|
| field | Data field holding the boolean value |
| showCheckAll | Show a select-all checkbox in the header |
| checkCls | CSS class for the checkbox |
See also
- WidgetColumn - Parent column that renders widgets
- Checkbox - The checkbox widget rendered in cells
Configs
Configs are options you supply in a configuration object when creating an instance of this class-
trueto show a checkbox in the column header to be able to select/deselect all rowsHas a corresponding runtime showCheckAll property.
-
trueto display a SlideToggle instead of a Checkbox -
The
aria-labelused for the default checkbox widget in this column’s cells.Has a corresponding runtime checkAriaLabel property.
-
The minimum column width. If value is a
Number, then the width is in pixelsHas a corresponding runtime minWidth property.
-
CSS class name to add to checkbox
Has a corresponding runtime checkCls property.
Properties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of CheckColumn class, or subclass thereof.
-
trueto show a checkbox in the column header to be able to select/deselect all rowsHas a corresponding showCheckAll config.
-
The
aria-labelused for the default checkbox widget in this column’s cells.Has a corresponding checkAriaLabel config.
-
Identifies an object as an instance of CheckColumn class, or subclass thereof.
-
The minimum column width. If value is a
Number, then the width is in pixelsHas a corresponding minWidth config.
-
CSS class name to add to checkbox
Has a corresponding checkCls config.