Yeah, I'm not too sure what to do... I don't think I have seen any examples/tutorials about dynamically generating FormPanels based on data returned by a store.
I don't think I can call render() because my FormPanel is in a ViewPort (as opposed to being rendered to a HTML element). Not sure if I can call onRender?
Here's what I'm doing (skipping the gory details):
Code:
MyPanel = Ext.extend(Ext.form.FormPanel, {
initComponent: function() {
this.store = new Ext.data.Store({
....
listeners: {
load: {
fn: buildForm
}
}
});
function buildForm(store, data, options) {
var obj = this.scope; // just for convenience
... create widgets ....
obj.items = [widgetsCreated];
MyPanel.superclass.initComponent.call(obj);
MyPanel.superclass.onRender.call(obj, obj.ownerCt); // i want the form to render now, after I finished adding all of the widgets (after the data store has finished loading)
}
}
});