PDA

View Full Version : Use Sencha Touch to upload file



leoliao
11 Aug 2011, 6:24 AM
I'm only test on andriod simulator27444

{
xtype: 'form',
id: 'frmInfo',
scroll: 'vertical',
margin: '0 0 0 0',
standardSubmit: true, //executes a standard HTML Form
//waitMsgTarget: true,
//dockedItems: [this.funBar],
items: [
xtype: 'urlfield',
id: 'fileAttach',
name: 'fileAttach',
label: 'Upload File',
inputType: 'file'
}],
listeners: {
afterrender: function(frm){
//set the attribute of enctype and method
Ext.getDom('frmInfo').enctype = 'multipart/form-data';
Ext.getDom('frmInfo').method = 'POST';
}
}
}

//submit form
var form = Ext.getCmp('frmInfo');
form.submit({
url: this.saveURL,
method: 'POST'
//waitMsg: {message:'saving...', cls : 'demos-loading'}
});

Hanni Sullivan
11 Aug 2011, 10:42 PM
And what exactly is your question?