PDA

View Full Version : Scroll to particular grid row ID



nick saint
23 Feb 2010, 2:55 PM
Hi, I am stuck with scrolling to particular grid row ID. I have a tree and I need to scroll a grid according to tree node ID


menu.on('click', function(n){
var sn = this.selModel.selNode || {};
if(n.leaf && n.id != sn.id){
var ds = Ext.getCmp('Grid').getStore();
Ext.getCmp('Grid').getView().focusRow(ds.getById(n.id));
}
});

Checked with manual but still cannot get it.
:-/ pls, help. Thank you. Nick

evant
23 Feb 2010, 3:03 PM
focusRow takes a number argument:



grid.getView().focusRow(store.indexOfId(id));

nick saint
23 Feb 2010, 3:22 PM
Thank you