PDA

View Full Version : FormPanel within Ext.Window how to access the Form before Dialog is first shown?



neongrau
14 Jul 2009, 5:30 AM
i've defined some form fields put them into a FormPanel and that is an item of an Ext.Window.

i thought i could do

dlg.getForm().load();
dlg.show();

or

dlg.getForm().findField('id').setValue(selected.id);
dlg.show();

but both things i do on the form just fail until the dialog was at least shown once.

is there a way to render the whole dialog with the form hidden?
the "hiden:true" option on the dialog didn't seem to change a thing.

exo
14 Jul 2009, 5:51 AM
Perhaps put this code in the 'render' event of the formpanel?

jay@moduscreate.com
14 Jul 2009, 5:52 AM
why are you worrying about setting the value before show? Why not do it after its rendered?

neongrau
14 Jul 2009, 6:00 AM
well the code to set the value and then show the field is placed on the dblclick event of a DataView.

i want to set the id from the record i clicked to edit it.

atm i can't figure out how i could entangle that with the render event :S

neongrau
14 Jul 2009, 6:05 AM
in fact: the setValue is pretty unneccessary. setting that value wouldn't be necessary if the form.load(...) would be executed.

atm it goes more like this:
the form sis supposed to show() itself on a successful load action and close on a successful save.