PDA

View Full Version : Forcing record to be visible in grid.



MichaelOstrovsky
15 Oct 2009, 1:42 AM
extension to gridpanel to allow simple scrolling to a record within.
usable when adding/loading new record that may be inserted anywhere in the grid.



// rec : the record element which needs to be scrolled to.
// use : myGrid.scrollRec(myRec);
Ext.grid.GridPanel.prototype.scrollRec=function(rec){
try {
this.getView().getRow(this.getStore().indexOf(rec)).scrollIntoView(this.getGridEl(), false);
}catch(e){}
}