【问题标题】:ExtJS 6 plugin.rowwidget Get binded record upon row body component creationExtJS 6 plugin.rowwidget 在创建行体组件时获取绑定记录
【发布时间】:2017-03-29 11:57:20
【问题描述】:

我有一个带有Ext.grid.plugin.RowWidget 的网格。当我展开行时,我必须使用行记录数据作为请求参数通过 ajax 加载一些数据,并在行体组件中显示加载的数据。

如何在创建行体组件时获取行记录数据?我试过initComponentafterrender 监听器,但我知道这不是合适的地方,因为数据还没有绑定。我必须听另一个事件还是?

这里是simple fiddle,说明了我的问题以及我已经尝试过的问题。

【问题讨论】:

  • 在 RowWidget 插件本身上使用 onWidgetAttach。这是将记录附加到组件的正确时间。
  • @evan-trimboli 谢谢!顺便说一句,我在文档中找不到这个小部件属性...我错过了什么吗?

标签: extjs extjs6


【解决方案1】:

感谢 Evan Trimboli,onWidgetAttach 似乎有效:

        plugins: [{
            ptype: 'rowwidget',
            widget: {
                xtype: 'characterPanel',
                bind: {
                    characterName: '{record.name}'
                },
            },
            onWidgetAttach: function (plugin, bodyComponent, record) {
                // Do stuff
            }
        }],

检查updated fiddle

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-29
    • 1970-01-01
    • 1970-01-01
    • 2020-02-11
    • 1970-01-01
    • 2017-02-21
    相关资源
    最近更新 更多