【问题标题】:ExtJS 4.2 : RowExpander - not workingExtJS 4.2:RowExpander - 不工作
【发布时间】:2014-01-10 01:24:26
【问题描述】:

我正在使用咖啡脚本在 ExtJS 4.2 MVC 样式应用程序中工作并尝试使用 rowExpander。网格似乎没有呈现“rowBodyTpl”,每当我单击以展开该行时,我都会收到一个错误:“未捕获的 TypeError:无法调用 null 的方法 'removeCls'”和“未捕获的 TypeError:无法调用”方法 'addCls' of null ' 任何见解或建议将不胜感激。

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 )

)

【问题讨论】:

    标签: extjs coffeescript deftjs


    【解决方案1】:

    我不使用coffeescript,所以我必须进行一些更改以使其成为纯JS。 你可以看看代码\运行它here。 如您所见,它工作得非常好。也许尝试从您的 Coffee 脚本生成 JS 并将其与我的示例进行比较。

    除了删除 Coffescript、删除 DeftJS 特定部分和添加我自己的内存存储所需的更改之外,最大的更改可能是:

    1. 个别功能周围缺少括号
    2. 调用 Ext.applyIf 而不是 Ext.apply

    【讨论】:

      猜你喜欢
      • 2013-03-23
      • 2013-05-21
      • 2015-08-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多