PDA

View Full Version : [OPEN] Component's event(s) suspending state is ignored by Controllers / Application



MaximGB
1 Apr 2013, 8:59 AM
REQUIRED INFORMATION


4.2.0
Ext 4.2.0 rev 663

Browser versions tested against:
Chrome (26.0.1410.43)

DOCTYPE tested against:
<!DOCTYPE HTML>

Description:
Component's event(s) suspending state is ignored by Controllers / Application if handlers are attached via controller's controll() method.

Steps to reproduce the problem:
Create any component, let's say Button Attach to it's 'click' event directly via button's on() method, console.log('Direct') in the handler Attach to it's 'click' event via controller's control() method, console.log('Control') in the handler Suspend button's events Click the button See the console output

The result that was expected:
- no output -

The result that occurs instead:
Control

Test Case:



function test()
{
var controller;

controller = Ext.create('Ext.app.Controller', {

refs : [{
ref : 'btn',
xtype : 'button',
autoCreate : true,
renderTo : Ext.getBody(),
text : 'Click me',
id : 'clickme'
}],

init : function()
{
this.getBtn().on('click', function() { console.log('Direct'); });

this.control({
'#clickme' : {
'click' : function() { console.log('Control'); }
}
});
}
});

controller.init();

controller.getBtn().suspendEvents();
}

Ext.onReady(test);

mitchellsimoens
1 Apr 2013, 9:04 AM
Thanks for the report! I have opened a bug in our bug tracker.

dongryphon
1 Apr 2013, 11:38 AM
FYI- This is a duplicate of http://www.sencha.com/forum/showthread.php?171525 so I am closing this ticket.

We have your test case in the tracker still though, so thanks for the thorough submission! :)

mcouillard
30 May 2013, 9:53 AM
Bump. Usage of control: {} is the preferred method of handling events in MVC. That's all we try to use. This bug is a big hindrance.

Tested on 4.1.2a