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

别等时光非礼了梦想. 提交于 2019-12-10 18:53:35

问题


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.

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.


回答1:


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
            }
        }],

Check updated fiddle.



来源:https://stackoverflow.com/questions/43092874/extjs-6-plugin-rowwidget-get-binded-record-upon-row-body-component-creation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!