extjs - Cloning filefiled in change function -
i have form include filefield like;
is possible? filefile can clone (with file attached) in change
function ( if possible, can change attribute textfield,..?)
here filefile http://jsfiddle.net/23tjk/
items: [{ xtype: 'filefield', name: 'file', fieldlabel: 'upload', labelwidth: 50, msgtarget: 'side', allowblank: false, anchor: '100%', listeners:{ 'change': function(f, value){ form.add([f]); // nothing run } } }],
you can create field variable:
var ffield = { xtype: 'filefield', fieldlabel: 'upload', name: 'file[]', //<-------- labelwidth: 50, msgtarget: 'side', allowblank: false, anchor: '100%', listeners:{ 'change': { fn: function(f, value) { form.add(ffield); }, single: true // <---------- } } }
in form:
... items: [ffield], ...
Comments
Post a Comment