PDA

View Full Version : suspend events doesnt seem to work



ahsec
3 Oct 2012, 1:06 AM
Hello all

I tried preventing a panel from triggering a 'move' event by doing

Ext.getCmp(panelsOrder[3]).suspendEvents(false);

However, when I invoke

Ext.getCmp(panelsOrder[3]).setPosition(width,height);

It does trigger the 'move' event handler...

Anything else I should have done and didn't?

Thanks

mitchellsimoens
10 Oct 2012, 8:48 AM
Running the following example in 4.1.2 doesn't fire the move event:


var panel = new Ext.panel.Panel({
renderTo : document.body,
width : 400,
height : 400,
items : [
{
xtype : 'button',
text : 'Move',
handler : function () {
panel.setPosition(
panel.x === 400 ? 0 : 400,
panel.y === 400 ? 0 : 400
);
}
},
{
xtype : 'button',
text : 'suspendEvents',
handler : function () {
panel.suspendEvents(false);
}
},
{
xtype : 'button',
text : 'resumeEvents',
handler : function () {
panel.resumeEvents();
}
}
],
listeners : {
move : function() {
console.log('moved');
}
}
});