|
App.component.ts
actionComplete(args) {
if (args.requestType === 'save' && this.isTabPressed) {
setTimeout(() => {
if (this.grid.getRows().length - 1 > args.rowIndex)
this.ispreventSelection = true;
this.grid.selectRow(args.rowIndex + 1); // select the next row to perform edit operation
}, 30);
}
}
rowSelected(args) {
if (this.isTabPressed && this.ispreventSelection) {
this.isTabPressed = false;
this.ispreventSelection = false;
this.grid.startEdit(); // edit the selected row.
}
}
public keyHandler(e) {
if (e.keyCode === 9 && this.grid.isEdit) {
let rowEle = parentsUntil(e.target, 'e-row', false);
let cellEle = parentsUntil(e.target, 'e-rowcell', false);
let rowInfo = this.grid.getRowInfo(rowEle);
if (
this.grid.getVisibleColumns().length - 1 ===
(cellEle as any).cellIndex
) {
this.isTabPressed = true;
this.grid.endEdit(); // save the current edited row here
}
}
} |