Last active
August 29, 2015 13:57
-
-
Save mitchellsimoens/9521712 to your computer and use it in GitHub Desktop.
Component element viewcontrollin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) {} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Scope of
onDivClick
would be of theFooController
so you can then do agetView
to get theFoo
view