我正在使用MVC Extjs,我希望在按钮的click事件上运行两个不同的函数.到目前为止这是我的控制器代码:
Ext.define('MyApp.controller.myController', {
extend: 'Ext.app.Controller',
runFirst: function(button, e, options) {
console.log('first function is running');
},
runSecond: function(button, e, options) {
console.log('second function is running');
},
init: function(application) {
this.control({
"#myButton": {
click: this.runFirst, runSecond //THIS PART DOESN'T WORK :(
}
});
}
});
Run Code Online (Sandbox Code Playgroud)
当我点击myButton时,我无法同时运行runFirst并runSecond运行.
您可以在此处下载所有代码:https://github.com/nitzaalfinas/Extjs-run-2-function-with-one-click/tree/one
你能告诉我如何在单击按钮上运行两个功能吗?