0

I'm working within a ExtJS 4.2 MVC style application using coffeescript and attempting to use rowExpander. The grid doesn't seem to render the 'rowBodyTpl' and whenever I click to expand the row I get an error : 'Uncaught TypeError: Cannot call method 'removeCls' of null ' when attempting to open it and 'Uncaught TypeError: Cannot call method 'addCls' of null ' Any insight or advice would be much appreciated.

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 )

)
Cadean
  • 61
  • 5

1 Answers1

0

I dont use coffeescript so i had to make few changes to make it plain JS. You can take a look at the code\run it here. As you can see, it works perfectly fine. Maybe try to generate JS from your Coffee script and compare it to my example.

Except the changes required to remove Coffescript, removing DeftJS specific parts and adding my own memory store, biggest change was probably:

  1. missing brackets around individual features
  2. Calling Ext.applyIf instead of Ext.apply
Michal Levý
  • 33,064
  • 4
  • 68
  • 86