2011-06-03 23 views
1

我有一个可以正常工作的标签面板, 但是只要我将网格面板应用为其中一个标签,在Observerable.js(来自ext的一个类)的某处发生了一个js错误,它说'item.on(...)'在'item is undefinded'后不是函数。将Ext.grid.Panel分配给Ext.tab.Panel时出错

下面是相应的代码行:

这是我在标签面板做:

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()”

回答

0

不能创建标签面板类似的项目发生:

this.items = [{ 
     xtype: 'profileList', 
     title: 'Profiles' 
    }]; 

您应该使用Ext.apply(...代替:

Ext.apply(this,{items:[{ 
     xtype: 'profileList', 
     title: 'Profiles' 
    }]); 
相关问题