私はExtJSを使用して簡単なUIを構築します。私はMain
とMenu
というビュークラスを2つ作成しました。その後、私はこれらのクラスを以下のように含めました。しかし、私はエラーに出会った。 TypeError: item.onAdded is not a function
がコンソールに印刷されました。ここに私のコードExtJS TypeError:item.onAddedは関数ではありません
Main.js
Ext.define('Ext1.view.Main', {
extend: 'Ext.container.Container',
requires:[
'Ext.tab.Panel',
'Ext.layout.container.Border'
],
items : [
{
xtype : 'menume'
}
]
});
Menu.js
Ext.define('Ext1.view.Menu',{
alias : 'widget.menume',
title: 'User Form',
height: 150,
width: 300,
bodyPadding: 10,
defaultType: 'textfield',
items: [
{
fieldLabel: 'First Name',
name: 'firstName'
},
{
fieldLabel: 'Last Name',
name: 'lastName'
},
{
xtype: 'datefield',
fieldLabel: 'Date of Birth',
name: 'birthDate'
}
]
});
Application.js
Ext.define('Ext1.Application', {
name: 'Ext1',
extend: 'Ext.app.Application',
views: [
'Ext1.view.Menu', 'Ext1.view.Main'
],
controllers: [
// TODO: add controllers here
],
stores: [
// TODO: add stores here
]
});
私が持っているのはなぜそのエラーがありますか?