简体   繁体   English

ExtJS 6 plugin.rowwidget在行体组件创建时获取绑定记录

[英]ExtJS 6 plugin.rowwidget Get binded record upon row body component creation

I have a grid with Ext.grid.plugin.RowWidget . 我有一个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. 当我扩展行时,我必须使用行记录数据作为请求参数通过ajax加载一些数据,并在行体组件中显示加载的数据。

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. 我已经尝试过initComponentafterrender监听器,但我知道它不合适,因为数据还没有绑定。 I have to listen for another event or? 我要听另一个活动还是?

Here is simple fiddle illustrating my problem and what I've tried already. 这是一个简单的小提琴,说明我的问题和我已经尝试过的。

Thanks to Evan Trimboli, onWidgetAttach seems to work: 感谢Evan Trimboli, onWidgetAttach似乎有效:

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

Check updated fiddle . 检查更新的小提琴

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM