Automatic reloading own component if a form is shown
in my current application I am trying to work with preconfigured classes.
I've got a combo-box subclass (MenuComboBox) which uses a JSON store to load its items from a SQL database (php backend).
I've got a generic editor form (BasicEditor) which consists of a modal window containing a formpanel. BasicEditor contains comon functions for form data submits and error handling.
I've got several Editor classes which inherit from BasicEditor.
The editor uses closeAction:'hide' to avoid rebuilding the editor each time it is called.
My MenuItemEditor class extends BasicEditor and provides the form elements which are shown by BasicEditor. One of the components is a MenuComboBox.
On first showing the MenuItemEditor the component gets its data from the server - perfect.
But if I add or remove Menus from the database the entries in MenuComboBox don't change because they just don't know about that...
So I want to reload the MenuComboBox-items when the editor is shown. The problem now is that the combo box doesn't get a show event or something like that. onRender does not work either because the component is already rendered. I can't register on parent item's show event because in some editors the combo box is inside a tab container...
Is there a generic method for handling this problem or must I reload the combo box from my editor subclass when it's shown?
Presumably you know when you are showing it, so issue a reload to the combo at the same time.
Ext.Window also fires a "show" event.