Skip to content

Instantly share code, notes, and snippets.

@mitchellsimoens
Last active August 29, 2015 13:57
Show Gist options
  • Save mitchellsimoens/9521712 to your computer and use it in GitHub Desktop.
Save mitchellsimoens/9521712 to your computer and use it in GitHub Desktop.
Component element viewcontrollin
Ext.define('MyApp.view.Foo', {
extend : 'Ext.Component',
xtype : 'myapp-foo',
requires : [
'MyApp.view.FooController'
],
controller : 'foocontroller',
tpl : '<div class="clickable">{foo}</div>',
listeners : {
element : 'el',
delegate : 'div.clickable',
click : 'onDivClick'
}
});
Ext.define('MyApp.view.FooController', {
extend : 'Ext.app.ViewController',
alias : 'controller.foocontroller',
config : {
control : {
'#' : { // or instead of listeners, use control config?
element : 'el',
delegate : 'div.clickable',
click : 'onDivClick'
}
}
},
onDivClick : function(e, t) {}
});
@mitchellsimoens
Copy link
Author

Scope of onDivClick would be of the FooController so you can then do a getView to get the Foo view

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment