What I would like to do is make a hidden form that I can submit using form.submit. I can't use Ext.Ajax.request because I'm also uploading files.
What I have:
function uploadRequest(){
var hiddenTextField = new Ext.form.TextField({
id: 'hiddenTextField'
});
var gridForm = new Ext.FormPanel({
id: 'hiddenForm',
fileUpload: true,
items: [hiddenTextField]
});
hiddenTextField.setValue('Test Value');
var form = Ext.getCmp('hiddenForm').getForm();
form.load(); // I want this to load hiddentextfield into the form?
form.submit({
url: '/main/grabValue',
waitMsg: 'Uploading...'
});
}
This works if instead of form.load() I add in:
var win = new Ext.Window({
height: 450,
width: 450,
closable: true,
items: [gridForm]
});
//I need something like a form.render that doesn't actually render here.
//hack that renders the form but also makes and shows a completely unnecessary form.
win.show();
How can I use form's built in submit functionality without rendering the form?