AutoScroll to Spare Row (Bottom) of Fixed Height HOT

Tags: #<Tag:0x00007fa98df7e520>

@aleksandra_budnik

Background:

  • I have Fixed Height Handsontable that can fit Header + 3 Rows and scrolls thereafter.
  • One of the column is of type checkbox.
  • minSpareRows is 1

Issue:
When the above table has more than 3 rows and a user checks the checkbox, as expected, a new spare row gets inserted but HOT doesn’t automatically scrolls to bring that row into viewport and every time user has to manually scroll to see newly added row.

Fiddle to demonstrate the issue - http://jsfiddle.net/7w5jz6bp/1/

Note: I have checked that it works when column type is text and user enters data into cell - HOT scrolls to bring new row into viewport.

Hey @saharsh.jain

you may want to try selectCell() method in the afterChange hook. The afterChange will share cell coordinates so you will know that the certain checkbox is changed. Then you can call the selectCell() with coordinates
column - 2
row - this.countRows()-1

Hi @aleksandra_budnik,

Thanks for the prompt help.

Though it kind of works with selectCell(), shouldn’t the scrolling work by default? Also, the api scrollViewportTo doesn’t work in this case. The reason I am asking is because by using selectCell(), all the cells upto the cell index I gave, gets selected (highlighted blue) in the new spare row.

It doesn’t scroll the viewport as changing the checkbox doesn’t select a cell below checkbox. It selects the cell only if the editor has been opened and closed.