How to deselect selected row

Tags: #<Tag:0x00007efc64e01bd8>

We are using checkbox to select complete row by not using the default row header.
And on click of checkbox I am using hot.selectRows(row); to select the row. Is there any method to deselect the selected row when user uncheck the checkbox

Thanks in advance

Hi @nihalshetty48

The method you can try to use in that case is deselectCell() which allows you to deselect current cells selection.

https://handsontable.com/docs/api/core/#deselectcell

How to I specify the row number with this?

You can’t specify the cells with this method. It works globally. Unfortunately we don’t have any API to deselect specific cells.

Is there any other method to deselect complete row by specifying row number?

Hi @nihalshetty48

As I said before, we don’t have such method.

Sorry what I meant was is there any other way to deselect the row?

Hey @nihalshetty48

As @adrian.szymanski mentioned, there is only one method for cell deselection

55
(https://handsontable.com/docs/api/core/#deselectcell)

and it removed the whole selection. No matter if one cell was selected, a whole row, or a whole table.

But in your case I recommend using the hot.selectRows(index); again - just without the row that is unchecked.