I am looking to create a hidden form that can be submitted using form.submit. Using Ext.Ajax.request is not an option for me because I need to upload files as well.
This is what I currently 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...'
});
}
The current solution involved adding the following code instead of form.load() :
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 utilize the form's built-in submit functionality without having to render the form?