Edit on tabbing wijmo flexgrid

Posted by: cdixon on 8 November 2017, 4:55 am EST

    • Post Options:
    • Link

    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?

  • Posted 8 November 2017, 5:48 pm EST

    Hi,

    You need to handle keydown and selectionchanged event for the same. Please refer to the plunker for the same:

    http://plnkr.co/edit/roJoxE0j17WYem1YC6DN?p=preview

    ~Manish

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels