X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2Fform%2FForm.js;h=9924baabd062710967324c8279975c19a52f782e;hb=d59b277dae414c8ed4dbc3522847f5f1b495081a;hp=1d15e92a39493e9eec98dcbb9a433825d6ce39e9;hpb=c17ca8c642fb74aa408cc95ee99b538b8b26098c;p=roojs1 diff --git a/Roo/form/Form.js b/Roo/form/Form.js index 1d15e92a39..9924baabd0 100644 --- a/Roo/form/Form.js +++ b/Roo/form/Form.js @@ -54,6 +54,16 @@ Roo.form.Form = function(config){ rendered : true }); + if (this.progressUrl) { + // push a hidden field onto the list of fields.. + this.addxtype( { + xns: Roo.form, + xtype : 'Hidden', + name : 'UPLOAD_IDENTIFIER' + }); + } + + Roo.each(xitems, this.addxtype, this); @@ -96,11 +106,17 @@ Roo.extend(Roo.form.Form, Roo.form.BasicForm, { monitorPoll : 200, /** - * @cfg {String} progressURL - Url to return progress data + * @cfg {String} progressUrl - Url to return progress data */ progressUrl : false, - + /** + * @cfg {boolean|FormData} formData - true to use new 'FormData' post, or set to a new FormData({dom form}) Object, if + * sending a formdata with extra parameters - eg uploaded elements. + */ + + formData : false, + /** * Opens a new {@link Roo.form.Column} container in the layout stack. If fields are passed after the config, the * fields are added and the column is closed. If no fields are passed the column remains open @@ -228,7 +244,7 @@ Roo.extend(Roo.form.Form, Roo.form.BasicForm, { if (!id) { return ret; } - Ext.each(this.allItems, function(f){ + Roo.each(this.allItems, function(f){ if (f.id == id || f.name == id ){ ret = f; return false; @@ -244,7 +260,11 @@ Roo.extend(Roo.form.Form, Roo.form.BasicForm, { * @param {String/HTMLElement/Element} container The element this component should be rendered into * @return {Form} this */ - render : function(ct){ + render : function(ct) + { + + + ct = Roo.get(ct); var o = this.autoCreate || { tag: 'form', @@ -255,17 +275,8 @@ Roo.extend(Roo.form.Form, Roo.form.BasicForm, { this.root.render(this.el); - if (this.progressUrl && !this.form.findField( 'UPLOAD_IDENTIFIER')) { - // push a hidden field onto the list of fields.. - this.items.unshift(0, Roo.factory( { - xns: Roo.form, - xtype : 'Hidden', - name : 'UPLOAD_IDENTIFIER' - })); - } - - - + + this.items.each(function(f){ f.render('x-form-el-'+f.id); });