Hi i have a panel and i want to scroll to a particular postiton in that panel how do i do it
var tabs= new Ext.Panel({
id:id,
title:text,
autoScroll:true,
iconCls:'windowIcon',
closable:true,
closeAction:'hide'
});
Set the scrollTop property of the panel's body to the number of pixels you want to scroll down:
// Scroll the body down by 100 pixels.
tabs.body.dom.scrollTop = 100;
Another option is to use the function scrollTo() here,
http://docs.sencha.com/extjs/3.4.0/#!/api/Ext.Element-method-scrollTo
e.g.
Ext.getCmp('graph_panel').body.scrollTo('left',250);
Ext.getCmp('graph_panel').body.scrollTo('top',200);
But scrollTo() function does not bound check to make sure the scroll is within this element's scrollable range whereas the scroll() function does, hence it is best to use the scroll() function.
e.g.
Ext.getCmp('graph_panel').body.scroll('left',300);
Ext.getCmp('graph_panel').body.scroll('bottom',300);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With