X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2Fform%2FForm.js;h=9924baabd062710967324c8279975c19a52f782e;hb=d59b277dae414c8ed4dbc3522847f5f1b495081a;hp=51e8a40bf53da7b639d57e3e22b3c9e0b0884e87;hpb=16cb56994e8a8c4670f21ee0c6d92b704af56d5b;p=roojs1 diff --git a/Roo/form/Form.js b/Roo/form/Form.js index 51e8a40bf5..9924baabd0 100644 --- a/Roo/form/Form.js +++ b/Roo/form/Form.js @@ -22,7 +22,7 @@ Roo.form.Form = function(config){ xitems = config.items; delete config.items; } - this.childForms = []; + Roo.form.Form.superclass.constructor.call(this, null, config); this.url = this.url || this.action; @@ -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); @@ -94,13 +104,19 @@ Roo.extend(Roo.form.Form, Roo.form.BasicForm, { * @cfg {Number} monitorPoll The milliseconds to poll valid state, ignored if monitorValid is not true (defaults to 200) */ monitorPoll : 200, - + + /** + * @cfg {String} progressUrl - Url to return progress data + */ + + progressUrl : false, /** - * childForms - used for multi-tab forms - * @type {Array} + * @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. */ - childForms : false, + 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 @@ -211,31 +227,7 @@ Roo.extend(Roo.form.Form, Roo.form.BasicForm, { return this; }, - /** - * Add a secondary form to this one, - * Used to provide tabbed forms. One form is primary, with hidden values - * which mirror the elements from the other forms. - * - * @param {Roo.form.Form} form to add. - * - */ - - - addForm : function(form){ - - this.childForms.push(form); - form.allItems.each(function (fe) { - - if (this.findField(fe.name)) { // already added.. - return; - } - this.add( new Roo.form.Hidden({ - name : fe.name - })); - - }, this); - - }, + @@ -252,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; @@ -268,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', @@ -278,7 +274,9 @@ Roo.extend(Roo.form.Form, Roo.form.BasicForm, { this.initEl(ct.createChild(o)); this.root.render(this.el); - + + + this.items.each(function(f){ f.render('x-form-el-'+f.id); });