Hello Syncfusion,
I have a problem with grid in batch mode. I want to start editing cell using enter key.
First problem:
When I press Enter key on selected cell(n) then it opens cell from the next row(n+1) - it happens probably, because firstly enter works as "go to next line", then start editing(my implemented functionality).
Second problem:
When I put new value, I want to save it also using enter key.
The problem is that when I finish editing and press enter it automatically goes to next row and start editing it.
I think the main problem is default enter behaviour. In normal mode this functionality works properly. Do you have any idea how to resolve it?
load() {
this.grid.element.addEventListener('keydown', (e: KeyboardEventArgs) => {
if (e.key === 'Enter') {
if ((e.target as HTMLElement).classList.contains('e-rowcell')) {
if (
this.
grid.
isEdit) {
const rIndex = Number((e.target as HTMLElement).getAttribute("Index"));
const cIndex = Number((e.target as HTMLElement).getAttribute("aria-colindex"));
const i: IIndex = { rowIndex: rIndex, cellIndex: cIndex };
const field: string = this.grid.getColumns()[cIndex].field;
this.grid.editCell((rIndex), field);
}
}
if (e.key === 'Escape') {
this.grid.closeEdit();
}
});
}