, 400px x 400px, Child, Parent 1000px x 1000px. , :
Ext.getCmp('id_of_Parent_panel').scrollBy(500, 500, true);
here scrollBy (x-value = 500, y-value = 500, animation = true), so the child panel scrolls diagonally (usually first horizontally and then vertically) using the parent panel ...
The following example is used to understand this concept ... I am using ExtJs 4.2.1
Ext.onReady(function () {
Ext.create('Ext.panel.Panel', {
title:'Parent',
height: 200,
autoScroll: true,
width: 700,
id:'Parent',
renderTo: Ext.getBody(),
items: [{
xtype: 'panel',
title: 'Child',
height: 1000,
width: 1000,
items:[{
xtype: 'button',
text: 'Please Scroll me....',
listeners: {
click: {
fn: function () {
Ext.getCmp('Parent').scrollBy(500, 500, true);
}
}
}
}]
}]
})
});
source
share