Well I just committed code on one of my projects enabling multiple file uploads using an ExtJs 3 TextField. And it appeared to me I can write a quick blog post about it.

So without wasting too much time, I will allow you to straightaway get your hands dirty with the code to produce multiple-file upload textfield:


{syntaxhighlighter brush: jscript;fontsize: 100; first-line: 1; }{
xtype: ‘textfield’,
inputType: ‘file’,
fieldLabel: ‘Multiple file selection’,
autoCreate: { tag: ‘input’, type: ‘text’, size: ’20’, autocomplete: ‘off’, multiple: ‘multiple’ },

The key here is the autoCreate config option of Ext.form.Field class (inherited by TextField) that we overrode to render a multiple=”multiple” attribute for the textfield’s dom.

And you can see the results below: