2011-06-03 25 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' 
    }]); 
相關問題