0
我想創建工廠函數按照factory-functions-in-ext-extensions, 下面是我的代碼問題與註冊的xtype
Ext.ns('MyApp');
MyApp.SubmitButton = Ext.extend(Ext.Button, {
text:'Submit'
,iconCls:'icon-disk'
,initComponent:function() {
MyApp.SubmitButton.superclass.initComponent.apply(this, arguments);
} // eo function initComponent
}); // eo extend
var btn = new MyApp.SubmitButton();
Ext.reg('submitbutton1',btn);//this is not working
Ext.reg('submitbutton', MyApp.SubmitButton);//this works
var win1;
if(!win1) {
win1 = new Ext.Window({
title : 'title',
closeAction : 'hide',
autoHeight : true,
autoWidth : true,
height : 300,
width : 500,
items : [{xtype:'submitbutton1',id:'submitbutton'}]
});
}
win1.show();
當我運行這個它拋出錯誤「B [d.xtype || E]是不是構造函數「