PDA

View Full Version : scroll top in extjs



deepakpoda2000
18 Dec 2012, 10:59 PM
Hi,
on some event, I want the window to scroll to the top
is there any thing in extjs , which can help me scroll to the top of the window

Cheers
Deepak

girish.arjunagi
19 Dec 2012, 5:49 AM
One way is to call the focus method of the first component of the window. Which will take the scroll to the top.

friend
19 Dec 2012, 5:59 AM
Also, Ext.dom.Element (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.dom.Element) supports a variety of scroll-related methods; scroll (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.dom.Element-method-scroll), scrollBy (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.dom.Element-method-scrollBy), scrollIntoView (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.dom.Element-method-scrollIntoView), and scrollTo (http://docs.sencha.com/ext-js/4-1/#!/api/Ext.dom.Element-method-scrollTo).

You can get an Element from most any rendered ExtJs component via the component's el property, e.g.:



var gridElement = someGridObject.el;