[OPEN] [#354] [2.x] Cell-Editing doesn't work in a locked Grid

  1. #1

    [OPEN] [#354] [2.x] Cell-Editing doesn't work in a locked Grid

    Last edited by Daniil; Sep 27, 2013 at 8:46 AM. Reason: [OPEN] [#354]
  2. #2
    Hi @g-tech,

    Thank you for the report. We will investigate.
  3. #3
  4. #4
    Please try the following fix.

    Fix
    Ext.grid.plugin.CellEditing.override({
        showEditor: function(ed, context, value) {
            var me = this,
                record = context.record,
                columnHeader = context.column,
                sm = me.grid.getSelectionModel(),
                selection = sm.getCurrentPosition(me.grid.view),
                otherView = selection && selection.view;
    
            // Selection is for another view.
            // This can happen in a lockable grid where there are two grids, each with a separate Editing plugin
            if (otherView && otherView !== me.view) {
                 return me.lockingPartner.showEditor(ed,  me.lockingPartner.getEditingContext(selection.record,  selection.columnHeader), value);
            }
    
            me.setEditingContext(context);
            me.setActiveEditor(ed);
            me.setActiveRecord(record);
            me.setActiveColumn(columnHeader);
    
            // Select cell on edit only if it's not the currently selected cell
             if (sm.selectByPosition && (!selection || selection.column !==  context.colIdx || selection.row !== context.rowIdx)) {
                if (!sm.isCellModel && sm.select) {
                    sm.select(record);
                }
                else {
                    sm.selectByPosition({
                        row: context.rowIdx,
                        column: context.colIdx,
                        view: me.view
                    });
                }
            }
    
            ed.startEdit(me.getCell(record, columnHeader), value, context);
            me.editing = true;
            me.scroll = me.view.el.getScroll();
        }
    });
    
    Ext.selection.RowModel.override({
        getCurrentPosition: function(view) {
            var firstSelection = this.selected.items[0];
            if (firstSelection) {
                return new Ext.grid.CellContext(view || this.view).setPosition(this.store.indexOf(firstSelection), 0);
            }
        }
    });
  5. #5
    It has been fixed in the revision #5729. It goes to the v2.5.1 release.
  6. #6
    This case is apparently no longer actual as of Ext.NET 4. There's no longer a showEditor override to CellEditing and tests with grids with locking columns worked fine.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 14
    Last Post: Apr 27, 2016, 12:22 AM
  2. Replies: 3
    Last Post: Mar 11, 2015, 7:28 PM
  3. [CLOSED] Tabing through Grid with Locked Column doesn't work...
    By rthiney in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 11, 2013, 9:39 PM
  4. [CLOSED] Grid editing doesn't work inside FieldSet
    By sisa in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Jun 20, 2013, 9:09 AM
  5. Replies: 4
    Last Post: May 03, 2013, 6:22 AM

Posting Permissions