PDA

View Full Version : GridView focusRow throws error



mhe
12 Feb 2010, 7:26 AM
Hi, I created an ExtJs window with a GridPanel and some other ExtJs controls on it. A store is already created from an XML and is fed into the "store" config option of a GridPanel.

The intended behavior would be, after calling "show()" on the window, a row of the grid is selected and focused on by a given row index. I was able to select the row using "grid.getSelectionModel().selectRow(rowIndex)" without a problem, but when I tried "grid.getView().focusRow(rowIndex)", I was getting an error. It seems to me that the view is not ready.

Can anyone help me on this please? Thank you!

tobiu
12 Feb 2010, 1:36 PM
seems like a rendering issue: if you try to select a row that is not rendered, it won't do.

you could try to use the store -> onLoad event or if you want to stay on window.show(), use a delay for the selection of the row (though it is not a clean way).

kind regards,
tobiu