How do press Enter key jump like Tab?

  1. #1

    How do press Enter key jump like Tab?

    In the GridPanel,I want to do this:
    when you press enter key,the focus jump from one column to next,like tab key.

    How do? Thanks.
  2. #2

    RE: How do press Enter key jump like Tab?

    Who can help me?
  3. #3

    RE: How do press Enter key jump like Tab?

    The behaviour of the Enter/Tab keys matches how you are working in a spreadsheet eg Excel, it has been so for ages
    Wonder why you want to change this?

  4. #4

    RE: How do press Enter key jump like Tab?

    The users like using 'the enter key',because they like using the Keypad to input quickly.
    So they want to the enter key replaces the tab key.
  5. #5

    RE: How do press Enter key jump like Tab?

    If the control hasn't this function,I think the leader couldn't agree using the gridpanel control.
  6. #6

    RE: How do press Enter key jump like Tab?

    Coolite controls wraps the ExtJS framework
    You need to dig into ExtJS to be able to get what you want
    http://www.extjs.com/

    If you're using the gridpanel control mainly for new records maybe you should reconsider your design?

    I am using the gridpanel for editing 50 to 100 records at the time (usually same column) I wouldn't change the enterkey behaviour in the grid for a million :)

  7. #7
    // Ext 3.3.1
    // added feature: moveEditorOnEnterLikeOnTab
    Ext.override(Ext.grid.RowSelectionModel, {
        moveEditorOnEnterLikeOnTab: false, // patch
        
        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.moveEditorOnEnterLikeOnTab)    // patch
                {
                    if(shift){
                        newCell = g.walkCells(last.row, last.col-1, -1, this.acceptsNav, this);
                    }else{
                        newCell = g.walkCells(last.row, last.col+1, 1, this.acceptsNav, this);
                    }
                }
                else 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){ // *** handle tabbing while editorgrid is in edit mode
                    ae = g.activeEditor;
                    if(ae && ae.field.triggerBlur){
                        // *** if activeEditor is a TriggerField, explicitly call its triggerBlur() method
                        ae.field.triggerBlur();
                    }
                }
                g.startEditing(r, c);
            }
        }
    });

Similar Threads

  1. [CLOSED] press the ENTER key
    By majunior in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: Nov 15, 2012, 10:13 PM
  2. Press Enter key should work on search button
    By Nagaraju in forum 1.x Help
    Replies: 1
    Last Post: Oct 09, 2011, 5:09 PM
  3. Replies: 1
    Last Post: Mar 09, 2010, 2:27 PM
  4. Replies: 0
    Last Post: Sep 10, 2009, 8:59 AM
  5. [CLOSED] How to jump to selected record when GridPanel reloads?
    By iansriley in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Mar 10, 2009, 11:55 AM

Posting Permissions