리턴 제어 문제를 해결하다

2476 단어 extGo

Ext.override(Ext.grid.RowSelectionModel, {   
                onEditorKey : function(field, e) {   
                    // alert('go');   
                    var k = e.getKey(), newCell, g = this.grid, ed = g.activeEditor;   
                    var shift = e.shiftKey;   
                    Ext.log('k:' + k);   
                    if (k == e.ENTER) {   
                        e.stopEvent();   
                        ed.completeEdit();   
                        if (shift) {   
                            newCell = g.walkCells(ed.row, ed.col - 1, -1,   
                                    this.acceptsNav, this);   
                        } else {   
                            // alert('go');   
                            newCell = g.walkCells(ed.row, ed.col + 1, 1,   
                                    this.acceptsNav, this);   
                        }   
                    } else if (k == e.TAB) {   
                        e.stopEvent();   
                        ed.completeEdit();   
                        if (this.moveEditorOnEnter !== false) {   
                            if (shift) {   
                                newCell = g.walkCells(ed.row - 1, ed.col, -1,   
                                        this.acceptsNav, this);   
                            } else {   
                                // alert('go');   
                                newCell = g.walkCells(ed.row + 1, ed.col, 1,   
                                        this.acceptsNav, this);   
                            }   
                        }   
                    } else if (k == e.ESC) {   
                        ed.cancelEdit();   
                    }   
                    if (newCell) {   
                        g.startEditing(newCell[0], newCell[1]);   
                    }   
                }   
            });   
    var sm2 = new Ext.grid.RowSelectionModel({   
        moveEditorOnEnter : true,   
        singleSelect : true,   
        listeners : {   
            rowselect : function(sm, row, rec) {   
                centerForm.getForm().loadRecord(rec);   
            }   
        }   
  
    });  


좋은 웹페이지 즐겨찾기