/**
* @class Roo.form.Form
* @extends Roo.form.BasicForm
+ * @children Roo.form.Column Roo.form.FieldSet Roo.form.Row Roo.form.Field Roo.Button Roo.form.TextItem
* Adds the ability to dynamically render forms with JavaScript to {@link Roo.form.BasicForm}.
* @constructor
* @param {Object} config Configuration options
rendered : true
});
- Roo.each(xitems, this.addxtype, this);
-
+ 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);
};
Roo.extend(Roo.form.Form, Roo.form.BasicForm, {
+ /**
+ * @cfg {Roo.Button} buttons[] buttons at bottom of form
+ */
+
/**
* @cfg {Number} labelWidth The width of labels. This property cascades to child containers.
*/
* @cfg {String} itemCls A css class to apply to the x-form-item of fields. This property cascades to child containers.
*/
/**
- * @cfg {String} buttonAlign Valid values are "left," "center" and "right" (defaults to "center")
+ * @cfg {String} (left|center|right) buttonAlign Valid values are "left," "center" and "right" (defaults to "center")
*/
buttonAlign:'center',
minButtonWidth:75,
/**
- * @cfg {String} labelAlign Valid values are "left," "top" and "right" (defaults to "left").
+ * @cfg {String} labelAlign (left|top|right) Valid values are "left," "top" and "right" (defaults to "left").
* This property cascades to child containers if not set.
*/
labelAlign:'left',
*/
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
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;
* @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',
this.root.render(this.el);
- if (this.progressUrl && !this.findField( 'UPLOAD_IDENTIFIER')) {
- // push a hidden field onto the list of fields..
- this.items.unshift( Roo.factory( {
- xns: Roo.form,
- xtype : 'Hidden',
- name : 'UPLOAD_IDENTIFIER'
- }));
- }
+
this.items.each(function(f){
f.render('x-form-el-'+f.id);