Go to edit mode after contextMenu.InsertRow

Tags: #<Tag:0x00007efc64e38f20>

Hello Team,

Need your help on the below scenarios:

  1. When I click “Insert row above” or “Insert row below” from contect menu I want have newly created row to be selected. But instead row below or row above newly added row is selected. Is it possible to select new row automatically?

Here https://jsfiddle.net/ek8gLhwt/1/ I try selectCell(), but it doesn’t work for me.

  1. Is it possible after clicking “Insert row above/below” not just select a cell from new row, but also enter edit mode?

Thanks,
Sergey Rachevsky

Good morning Sergey.

Ad.1. Here’s a demo https://jsfiddle.net/bekzL6st/
Ad.2. Yes, you just need to call getActiveEditor.open() method on a selected cell https://jsfiddle.net/bekzL6st/1/

Aleksandra, thank you very match!

I’ve tried in my own project and it works as I want.

I have just one more question. You suggested “10” as argument to setTimeout function. Is it okey to all similar cases or I should choose other timeout in some cases? Is there any recommendations for timeout value?

Sergey

I’ve used 10 to make sure that it will run after some laggy script but you can initiate the setTimeout without any value https://jsfiddle.net/xmcy9wsq/ and it should work the same (push the code inside to the last position on the script queue).

Got it.

Thank you again.
You answers here on forum make learning Handsontable much easier.

Sergey

The pleasure is all mine, Sergey :slight_smile: