Sergey Novikov
Sergey Novikov

Reputation: 4196

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

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.

Upvotes: 3

Views: 3040

Answers (1)

Sergey Novikov
Sergey Novikov

Reputation: 4196

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.

Upvotes: 2

Related Questions