2013-04-30 57 views
1

我試圖將extjs2的代碼更新爲extjs4,但我有一個錯誤和grid錯誤。我的谷歌Chrome瀏覽器返回錯誤Cannot read property 'isTree' of undefined無法讀取未定義Extjs的屬性'isTree'4

Ext.define('App.grid.GridPanel', { 
    extend: 'Ext.grid.GridPanel', 
    alias: 'widget.gridpanel', 
    frame: false, 
    loadMask: true, 
    stateful: false, 
    enableColumnHide: false, 
    showGridHeader: true, 
    viewConfig: {   
     stripeRows: true 
    }, 

    initComponent: function() { 
     if (!this.showGridHeader) { 
      this.addClass('grid-no-header'); 
     } 

     App.grid.GridPanel.superclass.initComponent.apply(this, arguments); 
    }, 

    getView : function(){ 
     if(!this.view){ 
      this.view = new App.grid.GridView(this.viewConfig); 
     } 
     return this.view; 
    } 
}); 
var grid = new App.grid.GridPanel({ 
     store: store, 
     columns: gridColumns, 
     frame: false, 
    // autoExpandColumn: 'name', 
     autoHeight: true, 
     loadMask: true, 
     bbar: pagingBar, 
     viewConfig: { 
      stripeRows: true, 
      scrollOffset: 2 
     } 
    });

即使當我改變App.grid.GridPanel.superclass.initComponent.apply(this, arguments);this.callParent(this, arguments);我收到了同樣的錯誤。 請幫忙。

+0

在下方有幫助嗎? – dbrin 2013-05-09 20:45:07

回答

1

由於已有的gridpanelhttp://docs.sencha.com/extjs/4.1.3/#!/api/Ext.grid.Panel一個的xtype,則不應使用widget.gridpanel作爲別名爲網格。

什麼是與getView?你沒有提供它的實現。

在您的initComponent方法中,按照指南中的說明使用this.callParent()。

將配置降至最低以使其處於正常工作狀態,然後添加您認爲必須的部分。

相關問題