PDA

View Full Version : submit field from another panel?



ekitel
5 Dec 2014, 5:51 PM
I have a main form panel with a number of fields and I have another field in another panel that I would like to submit along with the main form panel when that submits.

I could just copy the outlying field value into a hidden field in the main form that's submitting, BUT this is a file upload field. It's in another panel for layout purposes and there is other functionality associated it with it there for image preview sizing and positioning so it's not so easy for me to just move that field into the main form.

So is there any good way to do this is without having to re-work the whole panel and controller structure on the page?

ekitel
8 Dec 2014, 7:27 AM
Anyone? Sencha staff? I'd like to know if it's not even possible.

lumberjack
8 Dec 2014, 12:22 PM
The submit method can take an object specifying several parameters. One of those parameters is "params" which can be the values you'd like to send across.

Does this fiddle address your question?
enb

ekitel
8 Dec 2014, 12:49 PM
can I attach a file upload field to params?

if it was a simple text value I would have figured it out already, but this is a file upload

I don't think this is even possible, just thought I'd ask since ext.js seems to do so many amazing things....

lumberjack
9 Dec 2014, 11:57 AM
I've updated the fiddle. From my observations, if you submit from the form that contains the fileuploadfield and gather the additional params from the other fields, the payload seems to contain the file.

51237

ekitel
9 Dec 2014, 1:23 PM
Thanks for the idea, doing it the other way around, I hadn't thought of that!