4
votes

I have a grid with singleClickEdit set true.

I want to enter in edit mode when the grid finishes loading or when the user finishes editing a row. I have tried with API setFocusedCell(rowIndex, colKey, floating) but it just focus the cell without enter editing. The goal is to build speed editing grid and never use the mouse...

Is there a way to do that?

Thank you in advance!

1
May I ask how you get the colKey for focusing? I'm trying to achieve the same as you did but ag-grid is throwing stones in my way left and rightMichael Kargl

1 Answers

6
votes

You can get a reference to the grid by using gridReady/onGridReady callback and then call startEditingCell function on grid.api.

grid.api.startEditingCell(params): Starts editing the provided cell. If another cell is editing, the editing will be stopped in that other cell.

Parameters are as follows:
rowIndex: The row index of the row to start editing.
colKey: The column key of the column to start editing.
keyPress, charPress: The keyPress and charPress that are passed to the cellEditor