ashu2289
7 Nov 2012, 3:07 AM
Which Grid event is most suitable for selecting/autoscrolling to a particular row of the Grid. Have a look at this:
grid.getSelectionModel().select(rowIndex);
grid.getView().focusRow(recordID);
Using focusRow and select method i am able to select and gaining focus to a particular row. But what event is most suitable for this situation. I have tested 'afterrender', 'viewready', 'refresh' of GridView and scrollershow event but none of them assure that this code will be run when my grid and scroller are ready.
In my case, when all the data is rendered in the grid after that the scroller rendering starts.
Doing the stuff in scrollershow handler with a setTimeout/delay of 2seconds solves my problem but i do not want to rely on such time which may vary according to network/internet/browser speed and performance.
and if the records would less than the pageSize, scrollershow would not be triggered.
Please suggest a way out to this.
grid.getSelectionModel().select(rowIndex);
grid.getView().focusRow(recordID);
Using focusRow and select method i am able to select and gaining focus to a particular row. But what event is most suitable for this situation. I have tested 'afterrender', 'viewready', 'refresh' of GridView and scrollershow event but none of them assure that this code will be run when my grid and scroller are ready.
In my case, when all the data is rendered in the grid after that the scroller rendering starts.
Doing the stuff in scrollershow handler with a setTimeout/delay of 2seconds solves my problem but i do not want to rely on such time which may vary according to network/internet/browser speed and performance.
and if the records would less than the pageSize, scrollershow would not be triggered.
Please suggest a way out to this.