Select / Focus cell using SlickGrid

2019-07-21 09:17发布

问题:

How can I set the focus (or at least highlight) to a specific cell using SlickGrid, given that I have cell and row number?

Use case behind is that I have a grid which creates an ajax call each time the user changes something in the cell. Ideally the user should not recognize that the data has been send to the server. For the case that the data could not be saved at the server, the client gets informed via a callback and there I want to set the focus to the cell for which the values could not have been saved.

回答1:

grid.setActiveCell() and grid.focus()



回答2:

grid.gotoCell() worked for me better, as grid.setActiveCell() wasn't setting the field to an editable state.