PDA

View Full Version : How to scroll a container automatically so that a desired component come into view.



nilakantha
3 Feb 2012, 10:54 PM
How to scroll a container automaticallyso that a desired component with in the container come into view.

have a button.On clicking that buttonthe componet(gridCt.getComponent(7)),which is positioned quite belowin the container will come into view.


Here is my code...
// xtype: 'button', // default forToolbars
text: 'Select Grid',
listeners:{
click:function(){
console.log('Buttonclicked...');
var gridCt =Ext.getCmp('FRP.view.user.Tab.gridCt');
var cmp = gridCt.getComponent(7);
var gridEl =gridCt.getEl();
var cmpEl =cmp.getEl();
cmpEl.scrollIntoView(gridEl);
}
}


But this code is not working.
I am using Extjs 4.x

mitchellsimoens
4 Feb 2012, 6:19 AM
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.Element-method-scrollIntoView