2013-11-21 121 views
0

我正在使用coffeescript並嘗試使用rowExpander的ExtJS 4.2 MVC樣式應用程序中工作。網格似乎不呈現'rowBodyTpl',每當我點擊展開行我得到一個錯誤:'未捕獲的TypeError:無法調用方法'removeCls的空'試圖打開它時'未捕獲TypeError:無法調用方法'addCls'null'任何洞察力或建議將不勝感激。ExtJS 4.2:RowExpander - 不工作

Ext.define("Test.view.ExpandGrid", 
    extend: "Ext.grid.Panel" 

    alias: "widget.test-view-expandGrid" 
    controller: "Test.controller.ExpandGridController" 
    requires: [ "Ext.data.*", "Ext.grid.*", "Ext.grid.plugin.RowExpander" ] 
    inject: [ "testStore" ] 

    config: 
     testStore: null 

    plugins: [{ 
     ptype: 'rowexpander', 
     rowBodyTpl : [ 
     'something' 
     ] 
    }] 

    initComponent: -> 

     Ext.apply(@, 

     store: @getTestStore() 

     columns: [ 
      { text: "field1", dataIndex: "field1_data" }, 
      { text: "field2", dataIndex: "field2_data" }, 
      { text: "field3", dataIndex: "field3_data" } 
     ], 
     features: [ 
      ftype: "rowbody", 
      ftype: "rowwrap" 
     ] 




) 

@callParent(arguments) 

) 

回答

0

我不使用coffeescript所以我不得不作出一些更改,使其明確的JS。 你可以看看代碼\運行它here。正如你所看到的,它工作得很好。也許嘗試從您的Coffee腳本生成JS,並將其與我的示例進行比較。

除了去除Coffescript,除去DeftJS特定部分,增加了我的記憶存儲所需的變化,最大的變化可能是:

  1. 圍繞個人功能
  2. 調用Ext.applyIf,而不是缺少括號Ext.apply