一般来说,我是 extjs 的新手,特别是 4 版本:
我创建了一个类:
Ext.define('MyPanel', {
extend:'Ext.panel.Panel',
views: ["MyPanel"],
config: {
width: 200,
height: 300,
title: "HELLO"
},
constructor:function(config) {
this.initConfig(config);
return this;
},
alias: 'widget.MyPanel'
});
接下来,我想在 tabPanel items:[] 中以 XTYPE 的形式调用这个类:
我这样做了:
items: [{
title: 'Kontakt',
id: 'kontaktTab',
closable:true,
closeAction: 'hide',
layout: 'fit',
items:[{
xtype: "MyPanel"
}]
还没有运气,我得到的只是:
Cannot create an instance of unrecognized alias: widget.MyPanel"
你一定想,真是个菜鸟.... ;-)
有人请帮忙!!!