Framework : Angular6+ and Ag Grid Api
I have CellEditorcomponent which implement AgEditorComponent and upon key press, I am starting edit with agApi.startEditingCells(params) and Aginit() is executed for CellEditorComponent
this CellEditingStartedEvent is listen and a server call is made and based on response allow Editing. in order to make sure that user does not focus out from cell, I have re-called that agApi.startEditingCells(params) for same "Column and rowIndex with charpress, keyPress" but CellEditorComponent get destroyed and re-created again.
I have following :
1) How I can prevent agGridApi.StartEditingCell() from calling AgInit() of CellEditor twice.
2) is calling StartEditingCell() from same col and row index will re-created cellEditorcomponent?
If I understand correctly, you are calling
startEditingCellsfrom your CellEditorComponent. You shouldn't do that, because if your CellEditorComponent is active, then you are already editing. CallingstartEditingCellsis probably causing the grid to destroy your CellEditorComponent and create a new one, hence the multiple invocations ofagInitstartEditingCellsis meant for manually triggering editing from outside of the grid (usually from the grid's parent component).