问题
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