PDA

View Full Version : Order of calls to create Form in a Panel in a Dialog



rogrdat
16 Aug 2007, 9:45 PM
I'm trying to debug some issues with rendering a form in panel in a dialog. I am trying to figure out if I'm making the calls correctly.

1. Create Dialog but do no update layout yet.
2. Being Update of Dialog layout
3. Create Content panel
4. Add Content Panel to Dialog Layout
5. Make XHR call via the Panel's load method.
6. Create the form based on the XHR data in the callback method specified for the XHR call.
7. Render the form to the div associated with the panel.
8. End Dialog Layout update
9. Show Dialog

Could anyone validate these steps ?

thanks...,



var dlg = new Ext.LayoutDialog('myDialog', .......
var layout = dlg.getLayout();
layout.beginUpdate();
var panel = new Ext.ContentPanel('myForm', {title: 'The First Tab', fitToFrame:true, autoScroll:true, scripts:true} );
layout.add('center', panel);
// make XHR Request to create the form and update the panel
xhrRequest(argument, panel);
layout.endUpdate();
////////
function callBack() {
..... create form...,
from.render('myForm');
}
dlg.show();