Yes you Questions is correct... The following code used to scroll the child panel by clicking an event... here i added some more operation along with scrolling, here what i observed is, when i give animation = true to scroll method( Ext.getCmp('Parent').scrollBy(500, 500, true)) then what you said is correct because all the alert and console are executed before scrolling done... then i gave animation=false then the promraming order working fine with correct flow.
so console.log() and alert() are takes very less time to execute over animation... so come to your code, some animations are used inside extjs lib for loading purpose... thats why the order of flow changed..
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,
items: [{
xtype: 'button',
text: 'Please Scroll me....',
listeners: {
click: {
fn: function () {
alert('log 1 started');
console.log(1);
alert('log 1 ended');
alert('Scrolling started');
Ext.getCmp('Parent').scrollBy(500, 500, false);
alert('scrolling ended');
alert('windows finding started');
console.log(Ext.isWindows);
alert('finding ended');
alert('log 2 started');
console.log(2);
alert('log 2 ended');
}
}
}
}]
}]
})
});
I think its not a problem. because each process are work us independent way... for example see the following code
var a = 500;
console.log(a);
var b = 100;
console.log(b);
alert('scrolling started');
Ext.getCmp('Parent').scrollBy(a, b=10, true);
alert('scrolling ended');
console.log(b);
b = 200;
console.log(b);
so here the scrolling done by ony(x=500,y=10) not by y=100 or 200 so here its working fine sir... there is no error...