2
votes

In ExtJS3 I am using editor grid. On click of enter the focus automatically moves to the next row and moves the field into editor mode.

Is there anyway i can change the behavior and restrict the focus to move to next row, instead on hitting enter stay on the same field and move out of edit mode.

2

2 Answers

0
votes

Configure the keys property of the editor grid.

According to the api

keys : Object/Array

A Ext.KeyMap config object (in the format expected by Ext.KeyMap.addBinding used to assign custom key handling to this panel (defaults to null).

KeyMap is configured like so

var map = new Ext.KeyMap("editor-grid-id", {
    key: 13, // or Ext.EventObject.ENTER
    fn: myHandler, //return false to cancel the event, or whatever you want to do in the method
    scope: myObject  //the 'this' variable that you would like to use inside the myHandler method
});
0
votes

If you're using a RowSelectionModel, you can set moveEditorOnEnter to false in its config object.

http://docs.sencha.com/extjs/3.4.0/#!/api/Ext.grid.RowSelectionModel-cfg-moveEditorOnEnter