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.

It is mandatory to configure this column with a field (except when this column is used as a selection column, then no field should be provided). This is because the checked/unchecked state needs to be backed up in a record since rows are recycled and the state will be lost when a row is reused.
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;
             }
        }
    ]
});

Check column
//<code-header>
fiddle.title = 'Check column';
//</code-header>
// grid with CheckColumn
const grid = new Grid({
    appendTo   : targetElement,
    // makes grid as high as it needs to be to fit rows
    autoHeight : true,
    data       : DataGenerator.generateData(5),
    columns    : [
        { field : 'name', text : 'Name', flex : 1 },
        { type : 'check', field : 'done', text : 'CheckColumn', flex : 1, align : 'center' }
    ]
});

Configs

85

Common

autoWidthColumn
fieldColumn
fitModeColumn
flexColumn
listenersEvents
maxWidthColumn
textColumn
widgetsWidgetColumn
widthColumn

Accessibility

The aria-label used for the default checkbox widget in this column’s cells.

ariaLabelColumn

Layout

minWidth: Number | String= 30Also a property

The minimum column width. If value is a Number, then the width is in pixels

alignColumn
hiddenColumn
lockedColumn
regionColumn

Other

true to show a checkbox in the column header to be able to select/deselect all rows

true to display a SlideToggle instead of a Checkbox

formulaColumn
pinnedColumn
readOnlyColumn

Rendering

CSS class name to add to checkbox

afterRenderCellWidgetColumn
cellClsColumn
clsColumn
iconColumn
rendererWidgetColumn
tooltipColumn

Export

Integration

vueColumn

Interaction

collapsedColumn
draggableColumn
editorColumn
groupableColumn
hideableColumn
resizableColumn
sealedColumn
sortableColumn

Menu

Merge cells

mergeableColumn

Misc

localeClassLocalizable
localizableLocalizable
tagsColumn
treeColumn

Summary

sumColumn
summariesColumn

Properties

155

Common

autoWidthColumn
fieldColumn
fitModeColumn
flexColumn
maxWidthColumn
textColumn
widgetsWidgetColumn
widthColumn

Accessibility

The aria-label used for the default checkbox widget in this column’s cells.

ariaLabelColumn

Class hierarchy

isCheckColumn: Boolean= truereadonly
Identifies an object as an instance of CheckColumn class, or subclass thereof.
isCheckColumn: Boolean= truereadonlystatic
Identifies an object as an instance of CheckColumn class, or subclass thereof.
isColumnColumn
isEventsEvents
isLocalizableLocalizable
isModelModel
isModelLinkModelLink
isModelStmModelStm
isTreeNodeTreeNode
isWidgetColumnWidgetColumn

Layout

minWidth: Number | String= 30Also a config

The minimum column width. If value is a Number, then the width is in pixels

alignColumn
hiddenColumn
lockedColumn
regionColumn

Other

true to show a checkbox in the column header to be able to select/deselect all rows

$namestaticModel
defaultsColumn
elementColumn
formulaColumn
gridColumn
pinnedColumn
readOnlyColumn
relationsstaticModel
subGridColumn
typestaticColumn
visibleColumn

Rendering

CSS class name to add to checkbox

afterRenderCellWidgetColumn
cellClsColumn
clsColumn
iconColumn
rendererWidgetColumn
tooltipColumn

Editing

copyOfModel
isValidModel

Export

Fields

allFieldsstaticModel
autoExposeFieldsstaticModel
childrenFieldstaticModel
fieldMapstaticModel
fieldsstaticModel
idFieldstaticModel

Grouping

Identification

keyModel

Integration

vueColumn

Interaction

collapsedColumn
draggableColumn
editorColumn
groupableColumn
hideableColumn
resizableColumn
sealedColumn
sortableColumn

JSON

jsonModel

Lifecycle

configBase

Linked records

hasLinksModelLink
isLinkedModelLink
recordLinksModelLink

Menu

Merge cells

mergeableColumn

Misc

localeHelperLocalizable
localeManagerLocalizable
stmModelStm
tagsColumn
treeColumn

Parent & children

allChildrenTreeNode
childLevelTreeNode
firstChildTreeNode
isLeafTreeNode
isLoadedTreeNode
isParentTreeNode
isRootTreeNode
lastChildTreeNode
nextSiblingTreeNode
parentTreeNode
parentIdTreeNode

Summary

sumColumn
summariesColumn

Functions

78

Configuration

applyDefaultsstaticBase

Editing

copyModel
getDataModel
removeModel
setModel

Events

Fields

addFieldstaticModel
getModel
processFieldstaticModel
removeFieldstaticModel

Identification

asIdstaticModel

JSON

toJSONModel

Lifecycle

destroystaticBase

Misc

equalsModel
initClassstaticBase
isOfTypeNamestaticBase
linkModelLink
mixinstaticBase
optionalLstaticLocalizable

Other

hideColumn
LstaticLocalizable
onEvents
relayAllEvents
showColumn
toggleColumn
triggerEvents
unEvents

Parent & children

appendChildTreeNode
bubbleTreeNode
bubbleWhileTreeNode
containsTreeNode
isExpandedTreeNode
removeChildTreeNode
traverseTreeNode

Events

8

Fired when a cell is clicked to toggle its checked status. Returning false will prevent status change.

// Adding a listener using the "on" method
checkColumn.on('beforeToggle', ({ source, record, checked }) => {

});
ParameterTypeDescription
sourceColumn

This Column

recordModel

The record for the row containing the cell.

checkedBoolean

The new checked status of the cell.

Fired when a cell is clicked to toggle its checked status.

// Adding a listener using the "on" method
checkColumn.on('toggle', ({ source, record, checked }) => {

});
ParameterTypeDescription
sourceColumn

This Column

recordModel

The record for the row containing the cell.

checkedBoolean

The new checked status of the cell.

Fired when the header checkbox is clicked to toggle its checked status.

// Adding a listener using the "on" method
checkColumn.on('toggleAll', ({ source, checked }) => {

});
ParameterTypeDescription
sourceCheckColumn

This Column

checkedBoolean

The checked status of the header checkbox.

catchAllEvents
destroyEvents

Event handlers

8

Called when a cell is clicked to toggle its checked status. Returning false will prevent status change.

new CheckColumn({
    onBeforeToggle({ source, record, checked }) {

    }
});
ParameterTypeDescription
sourceColumn

This Column

recordModel

The record for the row containing the cell.

checkedBoolean

The new checked status of the cell.

Called when a cell is clicked to toggle its checked status.

new CheckColumn({
    onToggle({ source, record, checked }) {

    }
});
ParameterTypeDescription
sourceColumn

This Column

recordModel

The record for the row containing the cell.

checkedBoolean

The new checked status of the cell.

Called when the header checkbox is clicked to toggle its checked status.

new CheckColumn({
    onToggleAll({ source, checked }) {

    }
});
ParameterTypeDescription
sourceCheckColumn

This Column

checkedBoolean

The checked status of the header checkbox.

onDestroyEvents

Typedefs

2