Results 1 to 3 of 3

Thread: [4.1.0-rc3/GA] CellEditing plugin doesn't refocus edited cell when completing an edit

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-6025 in a recent build.
  1. #1
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default [4.1.0-rc3/GA] CellEditing plugin doesn't refocus edited cell when completing an edit

    In 4.1.0-rc3, the cellediting plugin does not refocus the edited cell when completing an edit.

    To reproduce:
    1. Open the cellediting example (<ext-4.1.0-rc3>/examples/grid/cell-editing.html)
    2. Click the "Adder's-Tongue" cell to commence editing, then change its value
    3. Press Enter to complete the edit
    4. The cell that was just edited is not refocused


    Cancelling an edit correctly refocuses the cell (blue highlight and all).


    Tested this against RC2 and the problem manifests itself there as well.

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,409

    Default

    Thank you for the report.

    Regards,
    Scott.

  3. #3
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default

    I came up with this override which works around the problem for me:
    Code:
    Ext.define('Ext.grid.plugin.CellEditingOverride', {
        override: 'Ext.grid.plugin.CellEditing',
    
        onEditComplete : function(ed, value, startValue) {
            var me = this,
                grid = me.grid,
                sm = grid.getSelectionModel(),
                activeColumn = me.getActiveColumn(),
                record;
    
            if (activeColumn) {
                record = me.context.record;
    
                me.setActiveEditor(null);
                me.setActiveColumn(null);
                me.setActiveRecord(null);
    
                if (!me.validateEdit()) {
                    return;
                }
    
    
                if (!record.isEqual(value, startValue)) {
                    record.set(activeColumn.dataIndex, value);
    //            } else {
    //                grid.getView().getEl(activeColumn).focus();
                }
    
                // *** bugfix -- refocus edited cell
                sm.setCurrentPosition(sm.getCurrentPosition());
                grid.getView().getEl(activeColumn).focus();
    
                me.context.value = value;
                me.fireEvent('edit', me, me.context);
            }
        }
    });

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •