我正在使用 MVC Extjs,我希望在按钮的单击事件上运行两个不同的函数。到目前为止,这是我的控制器代码:
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 :(
}
});
}
});
当我单击 myButton 时,我无法同时runFirst
运行。runSecond
您可以在此处下载所有代码:https ://github.com/nitzaalfinas/Extjs-run-2-function-with-one-click/tree/one
您能告诉我如何在单击一次按钮时运行两个功能吗?