Create interactive elements that can be checked or unchecked, by using the checkbox cell type.
Data in these cells will be rendered as a checkbox and can be easily changed by checking/unchecking the checkbox.
Checking the box can be performed using a mouse, or by pressing Space or Enter.
Unchecking the box can be performed using a mouse, or by pressing Space, Enter, Delete or Backspace.
You can change the state of multiple cells at once by selecting the cells you want to change and pressing Space.
This is the default usage scenario where column data has a
false value, and we only want to display checkboxes.
If you want to use values other than
false, you have to provide this information using
uncheckedTemplate. Handsontable will then update your data using the appropriate template.
To add a label to the checkbox, use the
label option. You can declare where the label will be injected with this option - either before or after the checkbox element. You can also declare from which data source the label text will be updated.
|Space||Space||Check or uncheck the checkbox||✗||✓|
|Enter||Enter||Check or uncheck the checkbox||✗||✓|
|Delete||Delete||Uncheck the checkbox||✗||✓|
|Backspace||Backspace||Uncheck the checkbox||✗||✓|