Fix #7197 - fix form layout files and doc labelalign
[roojs1] / Roo / form / FieldSet.js
1
2 /**
3  * @class Roo.form.FieldSet
4  * @extends Roo.form.Layout
5  * @children Roo.form.Column Roo.form.Row Roo.form.Field Roo.Button Roo.form.TextItem
6  * Creates a fieldset container for layout and rendering of fields in an {@link Roo.form.Form}.
7  * @constructor
8  * @param {Object} config Configuration options
9  */
10 Roo.form.FieldSet = function(config){
11     Roo.form.FieldSet.superclass.constructor.call(this, config);
12 };
13
14 Roo.extend(Roo.form.FieldSet, Roo.form.Layout, {
15     /**
16      * @cfg {String} legend
17      * The text to display as the legend for the FieldSet (defaults to '')
18      */
19     /**
20      * @cfg {String/Object} autoCreate
21      * A DomHelper element spec used to autocreate the fieldset (defaults to {tag: 'fieldset', cn: {tag:'legend'}})
22      */
23
24     // private
25     defaultAutoCreate : {tag: 'fieldset', cn: {tag:'legend'}},
26
27     // private
28     onRender : function(ct, position){
29         Roo.form.FieldSet.superclass.onRender.call(this, ct, position);
30         if(this.legend){
31             this.setLegend(this.legend);
32         }
33     },
34
35     // private
36     setLegend : function(text){
37         if(this.rendered){
38             this.el.child('legend').update(text);
39         }
40     }
41 });