我有一个标签面板,到目前为止工作正常,但一旦我应用一个网格面板作为其中一个标签我在Observerable.js(一个来自分机的类)的某个地方得到一个js-error,说' item.on(...)'在'item undefinded'之后不是一个函数
以下是相应的代码行:
这就是我在选项卡面板中的操作:
initComponent: function() { this.items = [{ xtype: 'profileList', title: 'Profiles' }]; this.callParent(arguments); }这是我的网格面板的代码:
Ext.define('BC.view.profile.ProfileList', { extend: 'Ext.grid.Panel', alias: 'widget.profileList', cls: 'profileList', border: false, initComponent: function(){ Ext.apply(this, { store: 'Profiles', columns: [{ text: 'Name', dataIndex: 'name', flex: 1, }, { text: 'Others', dataIndex: 'otherUsers', width: 200 }, { text: 'Limit', dataIndex: 'limit', width: 200 }] }); console.log('before'); this.callParent(arguments); console.log('after'); } });谢谢你的帮助!
编辑:第一个console.log工作,错误似乎发生在'callParent()'
i have a tab-panel which works fine so far, but as soon as i apply a grid-panel as one of the tabs i'm getting a js-error somewhere in Observerable.js (a class from ext) that say that 'item.on(...)' is not a function after 'item is undefinded'
Here are the appropriate code lines:
This is what i do in my tab panel:
initComponent: function() { this.items = [{ xtype: 'profileList', title: 'Profiles' }]; this.callParent(arguments); }and here is how the code of my grid panel:
Ext.define('BC.view.profile.ProfileList', { extend: 'Ext.grid.Panel', alias: 'widget.profileList', cls: 'profileList', border: false, initComponent: function(){ Ext.apply(this, { store: 'Profiles', columns: [{ text: 'Name', dataIndex: 'name', flex: 1, }, { text: 'Others', dataIndex: 'otherUsers', width: 200 }, { text: 'Limit', dataIndex: 'limit', width: 200 }] }); console.log('before'); this.callParent(arguments); console.log('after'); } });Thanks for any help!
Edit: the first console.log works, the error seems to happen in 'callParent()'
最满意答案
您不能像这样创建选项卡面板的项目:
this.items = [{ xtype: 'profileList', title: 'Profiles' }];你应该使用Ext.apply(...代替:
Ext.apply(this,{items:[{ xtype: 'profileList', title: 'Profiles' }]);You cannot create the items of the tab panel like that:
this.items = [{ xtype: 'profileList', title: 'Profiles' }];You should use Ext.apply(... instead:
Ext.apply(this,{items:[{ xtype: 'profileList', title: 'Profiles' }]);更多推荐
发布评论