I need to scroll to a form field (a displayfield actually) automatically. Since the field is dynamic, sometimes it is already shown in the rendered area of page, sometimes it is not.
How can I do this using ExtJS 4.x?
Use scrollTo function of Ext dom element. Reference
scrollTo( side, value, [animate] ) -> Scrolls this element the specified scroll point.
Parameters
Add following lines of code to the form panel.
listeners:{
afterrender: function(){
this.body.el.scrollTo('top',200,true);
}
},
field.getEl().scrollTo('top', 200, true);field.up('panel').scrollTo('top',200,true);formpanel. form.getEl().scrollTo('top',200,true); tried with various value parameter