PDA

View Full Version : Submit an editorgrid together with an Ext.form.FormPanel



dtex-lab
20 Jan 2012, 8:27 AM
Hi

I have a Ext.form.FormPanel containing may input fields and also an EditorGridPanel (with a related store).

Due my business logic the Grid / Store must be submitted with others form field (POST).

In my idea I should read the store and sinply add the store records to the request..
But I have a problem..
I m overriding the run function in Ext.form.Action.Submit
I just have a customization here because I need to submit also not rendered fields (maybe in tabs)... and it works fine..
But in the "form" object, items doesn't contains the EditorGridPanel .
It seems that the FormPanel fill the "items" only for "isField" component..
There is a way from the Form object have the list of ALL components ?

p.s.: I don't know the id of the EditorGridPanel, so I cannot use the getCmp function. I need to "loop" on each component
Thanks

mitchellsimoens
20 Jan 2012, 8:42 AM
When you do your form.submit, you can pass in the params:


form.submit({
params : {...}
});

dtex-lab
20 Jan 2012, 11:48 PM
Thank you

This means that I cannot do it in the Ext.form.Action.Submit.run method.
In your idea I should read store data and pass it to the submit as params when the user push the "submit" button.

I found another way.. probably it is not the best but it allow me to do it in the action submit run.
In my editor panel I defined 4 methods



getValue : Ext.emptyFn,
validate : function(){
return true;
},
setValue : Ext.emptyFn,
markInvalid: Ext.emptyFn,
clearInvalid: Ext.emptyFn,


(in the future I will implement also the get and set at least)
In this way also the editor panel is part of the form and so I can manage it directly from the action submit add