Results 1 to 2 of 2

Thread: NPE in GridSelectionModel onEditorKey()

  1. #1
    Sencha Premium Member
    Join Date
    Oct 2011

    Default NPE in GridSelectionModel onEditorKey()

    I have an EditorGrid where not all columns have an attached editor. When navigating the grid using the Tab key, I get a NPE. Somehow the editor is being returned as null.

    In the onEditorKey() method of GridSelectionModel there is a check to see if the editor is null, but then the editor is used in the call to grid.walkCells().

      public void onEditorKey(DomEvent e) {
        int k = e.getKeyCode();
        Cell newCell = null;
        CellEditor editor = grid.editSupport.getActiveEditor();
        switch (k) {
          case KeyCodes.KEY_ENTER:
          case KeyCodes.KEY_TAB:
            if (editor != null) {
            if ((k == KeyCodes.KEY_ENTER && moveEditorOnEnter) || k == KeyCodes.KEY_TAB) {
               *  if editor is null, as checked for above, then the lines below throw NPE
              if (e.isShiftKey())  {
                newCell = grid.walkCells(editor.row, editor.col - 1, -1, callback, true);
              } else {
                newCell = grid.walkCells(editor.row, editor.col + 1, 1, callback, true);
    I'm not sure why the editor is null, as that should be the source of the event. So I'm looking into that. But in the case when the editor really is null, how can navigation continue to the next editable cell?

  2. #2
    Sencha Premium Member
    Join Date
    Sep 2007


    Can you please provide a fully working testcase implementing EntryPoint?

Posting Permissions

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