问题
In the version 3.0.0-rc.21 of angular-ui-grid calls to scrollToFocus() to a cell in a grid with enableCellEditOnFocus set to true would move the cursor to that cell and it would be immediately editable. In version 3.0.7 this no longer works in certain cases (see below).
I call the scrollToFocus() after a navigate (tab) event. It checks the values of certain cells and will jump the user to the next line based on a certain condition. However, if the cell that the user would have tabbed to without the scrollToFocus() is editable, then I think it sends an endEdit event and the cell the user has the focus on is no longer editable.
If the cell that the user would have tabbed to is not editable, the scrollToFocus() works fine.
Please see the Plunker which has instructions on how to prove the issue. http://plnkr.co/edit/bV9CYdHEEksvRtFUglhr?p=preview
Basically, this line shows the issue
{ name: 'name2', displayName: 'Name2 (editable)', width: '20%', enableCellEdit: true },
If the line is like this, all works fine
{ name: 'name2', displayName: 'Name2 (editable)', width: '20%', enableCellEdit: false },
来源:https://stackoverflow.com/questions/33991169/scrolltofocus-to-cell-with-enablecelleditonfocus-true-does-not-make-the-cell-edi