X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=Roo%2Fform%2FFieldSet.js;fp=Roo%2Fform%2FFieldSet.js;h=56a7f965ab4864ff5f154ebbdac19b05b61ae6d0;hp=0000000000000000000000000000000000000000;hb=1cebb6d16aa3004663d63bdbc4d604fbcd8f2f5d;hpb=10db261e7d6b23c055f07797e9afef70ffed408a diff --git a/Roo/form/FieldSet.js b/Roo/form/FieldSet.js new file mode 100644 index 0000000000..56a7f965ab --- /dev/null +++ b/Roo/form/FieldSet.js @@ -0,0 +1,41 @@ + +/** + * @class Roo.form.FieldSet + * @extends Roo.form.Layout + * @children Roo.form.Column Roo.form.Row Roo.form.Field Roo.Button Roo.form.TextItem + * Creates a fieldset container for layout and rendering of fields in an {@link Roo.form.Form}. + * @constructor + * @param {Object} config Configuration options + */ +Roo.form.FieldSet = function(config){ + Roo.form.FieldSet.superclass.constructor.call(this, config); +}; + +Roo.extend(Roo.form.FieldSet, Roo.form.Layout, { + /** + * @cfg {String} legend + * The text to display as the legend for the FieldSet (defaults to '') + */ + /** + * @cfg {String/Object} autoCreate + * A DomHelper element spec used to autocreate the fieldset (defaults to {tag: 'fieldset', cn: {tag:'legend'}}) + */ + + // private + defaultAutoCreate : {tag: 'fieldset', cn: {tag:'legend'}}, + + // private + onRender : function(ct, position){ + Roo.form.FieldSet.superclass.onRender.call(this, ct, position); + if(this.legend){ + this.setLegend(this.legend); + } + }, + + // private + setLegend : function(text){ + if(this.rendered){ + this.el.child('legend').update(text); + } + } +}); \ No newline at end of file