0

Working with SlickGrid (v2.2). I am setting

enableAddRow: false,
autoEdit: true

I also have an editors for my columns. Tabbing through the editors works fine and it navigates to subsequent cells without issues. However, when in the last row, last cell.. tabbing out of the editor does not reset the cell. It does commit the changes however. The behavior I am looking for is, when there are no more cells to navigate to, it simply commits the changes and resets itself.

Anybody have any pointers?

Sujesh Arukil
  • 2,469
  • 16
  • 37

1 Answers1

1

You could try something like

grid.onCellChange.subscribe(function (e, args) {
    if (args.cell >= grid.getColumns().length - 1 &&
        args.row >= grid.getDataLength() - 1) {

        grid.getEditorLock().commitCurrentEdit();
    }
});

Update: see this question for a more robust fix for this tabbing issue.

Community
  • 1
  • 1
kavun
  • 3,358
  • 3
  • 25
  • 45
  • Not all my columns are editable. But I see where you are going with this. I will give this a shot. – Sujesh Arukil Oct 23 '13 at 16:01
  • Yea you could event subscribe to the `grid.onKeyDown` event for tab char, and check if it came from the last cell then call `resetActiveCell` if its not editable. – kavun Oct 24 '13 at 14:39