Brux88
Brux88

Reputation: 138

extjs 4 grid move the focus in a particular cell

I would like to move the focus in a particular cell, but if I insert the following code into the edit grid does not work:

var rowSelected2 = getWin(idWin, idGrid).view.getSelectionModel().getCurrentPosition().row;
var plugin2 = getWin(idWin, idGrid).getPlugin(idPlugin);
plugin2.startEdit(rowSelected2, 5);

why?

Upvotes: 1

Views: 7179

Answers (1)

lowlevelbass
lowlevelbass

Reputation: 56

To set a grid cell's focus using the API, you'll need to first make sure that you have added a selection model type of cellmodel to your grid.

selModel: {
     selType: 'cellmodel'
}

After that, you can set focus by issuing the following command:

grid.getSelectionModel().setCurrentPosition({row: 1, column: 1});

Good luck!

Upvotes: 4

Related Questions