为什么在 extjs 中通过 ID 查找后不能在选项卡上调用“添加”?
var tabPanel = new Ext.TabPanel({
id:'maintabs',
activeTab:0,
layoutOnTabChange:true,
deferredRender:false
});
var tab = {
title:'testing',
html:'testing'
}
I can see in my chrome console that tabPanel here has the method "add", and I can add this tab to the tab panel...
但是,当我像这样在视口中定义我的选项卡时......
initComponent: function(){
Ext.apply(this, {
layout: {
type: 'fit'
},
items: [
{
xtype: 'tabpanel',
id:'maintabs',
layoutOnTabChange:true,
deferredRender:false,
activeTab: 0, // index or id
items:[...
但是,考虑以下因素:
Ext.get('maintabs').add(tab);
TypeError: Object [object Object] has no method 'add'
这里给出了什么?为什么没有“添加”方法?