将Ext.grid.Panel分配给Ext.tab.Panel时出错(Error when assigning a Ext.grid.Panel to a Ext.tab.Panel)

编程入门 行业动态 更新时间:2024-10-28 16:25:16
将Ext.grid.Panel分配给Ext.tab.Panel时出错(Error when assigning a Ext.grid.Panel to a Ext.tab.Panel)

我有一个标签面板,到目前为止工作正常,但一旦我应用一个网格面板作为其中一个标签我在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' }]);

更多推荐

本文发布于:2023-07-24 10:59:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1245067.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Panel   grid   Ext   assigning   Error

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!