Posted 21 November 2019, 7:29 am EST
I have added an EventListener ‘keydown’ for the Flexgrid on which I am implementing the following logic to navigate to next cell:
const n = (window.event) ? e.which : e.keyCode;
let startRow = s.selection.row;
let startCol = s.selection.col;
if (n === 9) {
if(this.gridSelectionMode === SELECTION_MODE_CELL) {
if (startCol === s.columns.length - 1) {
if (startRow === s.rows.length - 1) {
startRow = 0;
startCol = 0;
} else if( startRow < s.rows.length ) {
startRow += 1;
startCol = 0;
}
} else {
startCol += 1;
}
}
this.gridSelectionMode = SELECTION_MODE_CELL;
this.flexGrid.selection = new CellRange(startRow, startCol);
}
e.preventDefault();
But when I select a row, I set the ‘selectionMode’ to ‘row’. So once I select a row and click ‘tab’, it is not listening to the tab event and hence not navigating a particular cell.
Can someone help me with this? Along with cell navigation, I also want tab to navigate to next cell when we have a row selected. Thank you.