Posted 8 November 2017, 4:55 am EST
We have several flexgrids with just names and values. We would like to be able to tab through all the values, and kick into editing mode as we tab, so the user doesn’t have to tab, click, tab, click, tab click.
I was able to tab through all the values thanks to another post here:
this.flexGrid.hostElement.addEventListener("keydown", e => {
const keyCode = e.keyCode || e.which;
if (keyCode === 9) {
let col = 1;
if (this.flexGrid.selection.row === this.flexGrid.rows.length - 1) {
return true;
}
let row = this.flexGrid.selection.row;
while (row !== this.flexGrid.rows.length - 1 && this.flexGrid.rows[row].isReadOnly) {
row++;
}
const cellRange = new wijmo.grid.CellRange(row, col);
this.flexGrid.select(cellRange);
// const cellElement = this.flexGrid.cells.getCellElement(row, col);
// cellElement.dispatchEvent(new CustomEvent('mousedown', { bubbles: false }));
// cellElement.dispatchEvent(new CustomEvent('click', { bubbles: false }));
// cellElement.dispatchEvent(new CustomEvent('tap', { bubbles: false }));
return false;
}
});
I’ve tried dispatching events to the cellElement, but that doesn’t kick it into editing mode. Is there a way to do this?