I have a controller defined like this:
Ext.define('MyApp.controller.TestController', {
extend: 'Ext.app.Controller',
config: {
},
showTest: function() {
alert('aaa');
}
});
How can i call the showTest() function? I tried this:
MyApp.controller.TestController.showTest();
But this doesn’t work. Anyone any idea how to do this..?? Because i want to call that function from an onClick even in a div. Something like:
<div onclick="call.controller.func(1)">User 1</div>
<div onclick="call.controller.func(2)">User 2</div>
etc.
No, you are doing it wrong.
Suppose that you have a button in your view:
The in your controller, inside your
controlobject:So in the above example: when user clicks inside the
xtypecalledmyapp-loginthe controller will execute theshowTest()method.