I am having a similar problem, though I have the grid in mu update window and I can display the values, some weird things are happening.
My update window:
Addon.window.Updateaddon = function(config) {
config = config || {};
Ext.applyIf(config,{
title: _('addon.addon_update')
,url: addon.config.connectorUrl
,baseParams: {
action: 'mgr/addon/update'
}
,fields: [{
xtype: 'hidden'
,name: 'id'
},{
xtype: 'textfield'
,fieldLabel: _('field1')
,name: 'field1'
,width: 300
},{
xtype: (config.record) ? 'addon-grid-addoncategory' : 'hidden'
,p_id: (config.record) ? config.record.id : 0
,fieldLabel: _('addon.categories')
}]
});
Addon.window.Updateaddon.superclass.constructor.call(this,config);
};
Ext.extend(Addon.window.Updateaddon,MODx.Window);
Ext.reg('addon-window-addon-update',Addon.window.Updateaddon);
The last field item is calling my grid and placing it in my window:
Addon.grid.AddonCategory = function(config) {
config = config || {};
Ext.applyIf(config,{
id: 'addon-grid-addoncategory'
,url: Addon.config.connectorUrl
,baseParams: { action: 'mgr/addoncategory/getList', parent_id: config.p_id|| 0 } /* pass the id from the window to the grid to fill */
,tbar: [{
xtype: 'button',
text: _('addon.addoncategory_create'),
handler: function() {
win = new Addon.window.CreateAddonCategory({
record: { parent_id: config.addon},
win: this.id
});
win.show();
}
}]
,viewConfig: {
forceFit: true,
enableRowBody: true
}
,fields: ['id','parent_id','category_id']
,paging: false
,remoteSort: true
,columns: [{
header: _('id')
,dataIndex: 'id'
,sortable: true
,width: 30
,hidden: true
},{
header: _('addon.parent')
,dataIndex: 'parent_id'
,sortable: true
,width: 30
,hidden: true
},{
header: _('addon.categories')
,dataIndex: 'category_id'
,sortable: true
,width: 50
,editor: { xtype:'addon-combo-category' ,renderer: true }
}]
});
Addon.grid.AddonCategory.superclass.constructor.call(this,config);
};
Ext.extend(Addon.grid.AddonCategory,MODx.grid.Grid);
Ext.reg('addon-grid-addoncategory',Addon.grid.AddonCategory);
And then I call this update window from my main grid with:
,updateAddon: function(btn,e) {
win = new Addon.window.UpdateAddon({
record: this.menu.record
,listeners: {
'success': {fn:this.refresh,scope:this}
}
});
win.show(e.target);
}
Everything works great when I use this on a single record, but then I try to update another record, the grid does not appear and I get the "Categories" label repeated about 5 times. You can see these in the attachments.
I am missing something somewhere, I would really appreciate some help.