# FieldSet.js

    /**
     * @class Ext.form.FieldSet
     * @extends Ext.Panel
     * Standard container used for grouping form fields.
     * @constructor
     * @param {Object} config Configuration options
     */
    Ext.form.FieldSet = Ext.extend(Ext.Panel, {
        /**
         * @cfg {Mixed} checkboxToggle True to render a checkbox into the fieldset frame just in front of the legend,
         * or a DomHelper config object to create the checkbox.  (defaults to false).
         * The fieldset will be expanded or collapsed when the checkbox is toggled.
         */
    // holder
    /***
         * @cfg {String} checkboxName The name to assign to the fieldset's checkbox if {@link #checkboxToggle} = true
         * (defaults to '[checkbox id]-checkbox').
         */
    // holder
    /***
         * @cfg {Number} labelWidth The width of labels. This property cascades to child containers.
         */
    // holder
    /***
         * @cfg {String} itemCls A css class to apply to the x-form-item of fields. This property cascades to child containers.
         */
    // holder
    /***
         * @cfg {String} baseCls The base CSS class applied to the fieldset (defaults to 'x-fieldset').
         */
        baseCls:'x-fieldset',
        /**
         * @cfg {String} layout The {@link Ext.Container#layout} to use inside the fieldset (defaults to 'form').
         */
        layout: 'form',
        /**
         * @cfg {Boolean} animCollapse
         * True to animate the transition when the panel is collapsed, false to skip the animation (defaults to false).
         */
        animCollapse: false,

        // private
        onRender : function(ct, position){
            if(!this.el){
                this.el = document.createElement('fieldset');
                this.el.id = this.id;
                if (this.title || this.header || this.checkboxToggle) {
                    this.el.appendChild(document.createElement('legend')).className = 'x-fieldset-header';
                }
            }

            Ext.form.FieldSet.superclass.onRender.call(this, ct, position);

            if(this.checkboxToggle){
                var o = typeof this.checkboxToggle == 'object' ?
                        this.checkboxToggle :
                        {tag: 'input', type: 'checkbox', name: this.checkboxName || this.id+'-checkbox'};
                this.checkbox = this.header.insertFirst(o);
                this.checkbox.dom.checked = !this.collapsed;
                this.checkbox.on('click', this.onCheckClick, this);
            }
        },

        // private
        onCollapse : function(doAnim, animArg){
            if(this.checkbox){
                this.checkbox.dom.checked = false;
            }
            Ext.form.FieldSet.superclass.onCollapse.call(this, doAnim, animArg);

        },

        // private
        onExpand : function(doAnim, animArg){
            if(this.checkbox){
                this.checkbox.dom.checked = true;
            }
            Ext.form.FieldSet.superclass.onExpand.call(this, doAnim, animArg);
        },

        /* //protected
         * This function is called by the fieldset's checkbox when it is toggled (only applies when
         * checkboxToggle = true).  This method should never be called externally, but can be
         * overridden to provide custom behavior when the checkbox is toggled if needed.
         */
        onCheckClick : function(){
            this[this.checkbox.dom.checked ? 'expand' : 'collapse']();
        },

        // private
        beforeDestroy : function(){
            if(this.checkbox){
                this.checkbox.un('click', this.onCheckClick, this);
            }
            Ext.form.FieldSet.superclass.beforeDestroy.call(this);
        }

        /**
         * @cfg {String/Number} activeItem
         * @hide
         */
    // holder
    /***
         * @cfg {Mixed} applyTo
         * @hide
         */
    // holder
    /***
         * @cfg {Object/Array} bbar
         * @hide
         */
    // holder
    /***
         * @cfg {Boolean} bodyBorder
         * @hide
         */
    // holder
    /***
         * @cfg {Boolean} border
         * @hide
         */
    // holder
    /***
         * @cfg {Boolean/Number} bufferResize
         * @hide
         */
    // holder
    /***
         * @cfg {String} buttonAlign
         * @hide
         */
    // holder
    /***
         * @cfg {Array} buttons
         * @hide
         */
    // holder
    /***
         * @cfg {Boolean} collapseFirst
         * @hide
         */
    // holder
    /***
         * @cfg {String} defaultType
         * @hide
         */
    // holder
    /***
         * @cfg {String} disabledClass
         * @hide
         */
    // holder
    /***
         * @cfg {String} elements
         * @hide
         */
    // holder
    /***
         * @cfg {Boolean} floating
         * @hide
         */
    // holder
    /***
         * @cfg {Boolean} footer
         * @hide
         */
    // holder
    /***
         * @cfg {Boolean} frame
         * @hide
         */
    // holder
    /***
         * @cfg {Boolean} header
         * @hide
         */
    // holder
    /***
         * @cfg {Boolean} headerAsText
         * @hide
         */
    // holder
    /***
         * @cfg {Boolean} hideCollapseTool
         * @hide
         */
    // holder
    /***
         * @cfg {String} iconCls
         * @hide
         */
    // holder
    /***
         * @cfg {Boolean/String} shadow
         * @hide
         */
    // holder
    /***
         * @cfg {Number} shadowOffset
         * @hide
         */
    // holder
    /***
         * @cfg {Boolean} shim
         * @hide
         */
    // holder
    /***
         * @cfg {Object/Array} tbar
         * @hide
         */
    // holder
    /***
         * @cfg {Boolean} titleCollapse
         * @hide
         */
    // holder
    /***
         * @cfg {Array} tools
         * @hide
         */
    // holder
    /***
         * @cfg {String} xtype
         * @hide
         */
    // holder
    /***
         * @property header
         * @hide
         */
    // holder
    /***
         * @property footer
         * @hide
         */
    // holder
    /***
         * @method focus
         * @hide
         */
    // holder
    /***
         * @method getBottomToolbar
         * @hide
         */
    // holder
    /***
         * @method getTopToolbar
         * @hide
         */
    // holder
    /***
         * @method setIconClass
         * @hide
         */
    // holder
    /***
         * @event activate
         * @hide
         */
    // holder
    /***
         * @event beforeclose
         * @hide
         */
    // holder
    /***
         * @event bodyresize
         * @hide
         */
    // holder
    /***
         * @event close
         * @hide
         */
    // holder
    /***
         * @event deactivate
         * @hide
         */
    });
    Ext.reg('fieldset', Ext.form.FieldSet);

Ext - Copyright © 2006-2007 Ext JS, LLC
All rights reserved.