Hey,
I have been playing with the idea of adding an extra tab to MODx.panel.Resource when creating/editing a document. Everything I have tried (and seen from code repos) has achieved this by adding to the existing methods used by
MODx.panel.Resource. The issue I have with that is it requires that the existing MODx items be re-added meaning it can only work once and would break or not include additional code trying to do the same thing.
I still haven't gotten around to spending much time with ExtJS so my approach is warped

. It feels hacky so I would appreciate any suggestions on how to add items to existing panels created by MODx.
Here is my hacky code that will probably make more sense then me:
Ext.extend(MODx.panel.ExtraTab, MODx.panel.Resource, {
initComponent: function() {
extraTabExt = this.getExtraFields();
existingPanelItems = this.items;
/**
* There must be a better way of doing this! Hacky
*/
tabSize = 0;
extraEntry = 2; // Enter after settings/second tab
newPanelItems = existingPanelItems;
for (i in existingPanelItems[1]['items']) {
if(existingPanelItems.hasOwnProperty(i)) {
if (i < extraEntry) {
newPanelItems[1]['items'][tabSize] = existingPanelItems[1]['items'][tabSize];
}
else {
newPanelItems[1]['items'][(tabSize + 1)] = existingPanelItems[1]['items'][tabSize];
}
tabSize++;
}
}
// Add extra tab
newPanelItems[1]['items'][extraEntry] = extraTabExt;
this.items = [newPanelItems];
MODx.panel.ExtraTab.superclass.initComponent.call(this);
},
...