Setting a value of a cell based on previous cell value

Hello Team,

I am new to Handontable and I am still exploring it to use it in my application. I have a requirement that whenever user presses tab/enter keys on keyboard, based on the cell I am in, it needs to auto set the data in next cell moved.

For example: If Cell [0][0] has value “1. Testing”, then if I press tab from this cell, next cell would be Cell[0][1] it should have value “1.1” and if I had pressed enter key from this cell, next cell would be Cell [1][0] would be set to value “2.”. Something like hierarchical numbering. I tried afterChange and beforeChange events but it doesnt hold the previous cell value all the time. Please let me know if I am missing anything here.

Regards,
Vani

Hi @vanivkulkarni

If your scenario is a little bit more complicated than what tabMoves can offer (src: https://docs.handsontable.com/pro/3.0.0/Options.html#tabMoves) you can use the hook called afterDocumentKeyDown https://docs.handsontable.com/pro/3.0.0/Hooks.html#event:afterDocumentKeyDown