【发布时间】:2014-01-17 13:17:19
【问题描述】:
在 App.js 文件的 launch() 函数中,我有以下代码:
launch: function() {
// Destroy the #appLoadingIndicator element
Ext.fly('appLoadingIndicator').destroy();
// Initialize the main view
Ext.Viewport.add(Ext.create('SenchaApp.view.Main'));
},
在 View.js 文件中,我有以下代码:
var button = Ext.create('Ext.Button', { text: 'Click me',
handler: function() {
alert('You clicked the button!')
}}
);
Ext.define("SenchaApp.view.Main", {
extend: 'Ext.Panel',
config: { items: [button]}
});
问题是按钮的事件永远不会触发,所以按钮不起作用。
这是什么原因??
【问题讨论】:
标签: javascript events button extjs sencha-touch-2.1