Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Disabling Tab And Enter In EditorGrid

  1. #11
    Ext JS Premium Member
    Join Date
    May 2010
    Posts
    32
    Vote Rating
    1
      0  

    Default Is there a better way to do this in Ext 3.3 ?

    Is there a property or event that will prevent the next cell from automatically going into edit mode ?

  2. #12
    Sencha Premium Member darwin_e's Avatar
    Join Date
    Nov 2012
    Posts
    10
    Vote Rating
    0
      0  

    Default

    Hi GreenEyed,

    Where did I put this code?

    Thanks in advance.

  3. #13
    Ext JS Premium Member
    Join Date
    Apr 2011
    Posts
    93
    Vote Rating
    3
      0  

    Default

    FYI, i know this is old, but moveEditorOnEnter is probably what you're looking for. Unfortunately, there is no similar property for tab, but you can look at the code where moveEditorOnEnter is used in the ExtJS source and replicate the functionality for tab as well.

    Code:
        onEditorKey : function(field, e){        var k = e.getKey(), 
                newCell, 
                g = this.grid, 
                last = g.lastEdit,
                ed = g.activeEditor,
                shift = e.shiftKey,
                ae, last, r, c;
                
            if(k == e.TAB){
                e.stopEvent();
                ed.completeEdit();
                if(shift){
                    newCell = g.walkCells(ed.row, ed.col-1, -1, this.acceptsNav, this);
                }else{
                    newCell = g.walkCells(ed.row, ed.col+1, 1, this.acceptsNav, this);
                }
            }else if(k == e.ENTER){
                if(this.moveEditorOnEnter !== false){
                    if(shift){
                        newCell = g.walkCells(last.row - 1, last.col, -1, this.acceptsNav, this);
                    }else{
                        newCell = g.walkCells(last.row + 1, last.col, 1, this.acceptsNav, this);
                    }
                }
            }
            if(newCell){
                r = newCell[0];
                c = newCell[1];
    
    
                this.onEditorSelect(r, last.row);
    
    
                if(g.isEditor && g.editing){ 
                    ae = g.activeEditor;
                    if(ae && ae.field.triggerBlur){
                        
                        ae.field.triggerBlur();
                    }
                }
                g.startEditing(r, c);
            }
        },

Page 2 of 2 FirstFirst 12

Posting Permissions

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