PDA

View Full Version : MVC: 'dblclick' event in Ext.panel.Panel using a Controller



neurodon
3 Jul 2012, 10:29 AM
I am moving the "field editor" example code over from just the view and putting it in to a controller.

Capturing 'dblclick' in a form works when you use the ".on()" method, but not when you use ComponentQuery.

For example: This works in the 'app.controls.fieldeditor' view...



initComponent: function(config) {
var me = this;
this.on({dblclick: { fn: this.startEdit, scope:this, element:'body'}});
me.callParent(arguments);
}



However this does not work in the controller:


init: function() {
this.control({
'[xtype="app.controls.fieldeditor"]': {
dblclick: {
fn: this.startEdit, scope:this, element:'body'
}
}
});
},


What am I doing wrong?

scottmartin
3 Jul 2012, 12:22 PM
Please try the following:



me.control({
'app.controls.fieldeditor' : {
itemdblclick : this.startEdit
},
..
});


Scott