PDA

View Full Version : Need to focus row in grid



funwithextjs
11 Feb 2011, 8:51 AM
Hi I have grid panel which contains 100 records. I am pointing these 100 records onto Map. When i click 1 record on the map, it should select that record in the grid and focus that record.Please help me. Thanks

steffenk
11 Feb 2011, 9:17 AM
grid.getView().focusRow(row);
grid.getSelectionModel().selectRow(row);

funwithextjs
11 Feb 2011, 11:12 AM
I did that way, the row is getting selected, focus is not working.

steffenk
11 Feb 2011, 2:10 PM
what do you expect? At least it scrolls the row in the view. But for sure there is no cursor.

Condor
12 Feb 2011, 12:40 AM
And you have to make sure the map isn't stealing the focus back (try calling focusRow with a delay).

funwithextjs
13 Feb 2011, 11:42 AM
@Condor...

How can we check whether map has gained focus back. If so how to apply delay for the focusRow method. Can you please post me some code.

Condor
17 Feb 2011, 2:26 AM
(function(){
grid.getView().focusRow(row);
grid.getSelectionModel().selectRow(row);
}).defer(200);