ExtJS 6 plugin.rowwidget在创建行主体组件时获取绑定记录 [英] ExtJS 6 plugin.rowwidget Get binded record upon row body component creation

查看:232
本文介绍了ExtJS 6 plugin.rowwidget在创建行主体组件时获取绑定记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a grid with Ext.grid.plugin.RowWidget. When I expand row I have to load some data via ajax using row record data as request parameters and display loaded data in a row body component.

如何在创建行主体组件时获取行记录数据?我已经尝试过initComponentafterrender侦听器,但是我知道这是不合适的地方,因为尚未绑定数据.我必须听另一个事件吗?

How I can get row record data upon row body component creation? I've tried initComponent and afterrender listener, but I understand that it is not appropriate place because data is not binded yet. I have to listen for another event or?

这是简单的小提琴,它说明了我的问题以及我所做的事情已经尝试过了.

Here is simple fiddle illustrating my problem and what I've tried already.

推荐答案

感谢Evan Trimboli,onWidgetAttach似乎可以工作:

Thanks to Evan Trimboli, onWidgetAttach seems to work:

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

检查更新的小提琴.

这篇关于ExtJS 6 plugin.rowwidget在创建行主体组件时获取绑定记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆