function(values) {
        var fields = this.getFields(),
            me = this,
            name, field, value, ln, i, f;

        values = values || {};

        for (name in values) {
            if (values.hasOwnProperty(name)) {
                field = fields[name];
                value = values[name];

                if (field) {
                    // If there are multiple fields with the same name. Checkboxes, radio fields and maybe event just normal fields..
                    if (Ext.isArray(field)) {
                        ln = field.length;

                        // Loop through each of the fields
                        for (i = 0; i < ln; i++) {
                            f = field[i];

                            if (f.isRadio) {
                                // If it is a radio field just use setGroupValue which will handle all of the radio fields
                                f.setGroupValue(value);
                                break;
                            } else if (f.isCheckbox) {
                                if (Ext.isArray(value)) {
                                   f.setChecked((value.indexOf(f._value) != -1));
                               } else {
                                   f.setChecked((value == f._value));
                               }
                            } else {
                                // If it is a bunch of fields with the same name, check if the value is also an array, so we can map it
                                // to each field
                                if (Ext.isArray(value)) {
                                    f.setValue(value[i]);
                                }
                            }
                        }
                    } else {
                        if (field.isRadio || field.isCheckbox) {
                            // If the field is a radio or a checkbox
                            field.setChecked(value);
                        } else {
                            // If just a normal field
                            field.setValue(value);
                        }
                    }

                    if (me.getTrackResetOnLoad()) {
                       field.resetOriginalValue();
                    }
                }
            }
        }

        return this;
    }
function(values) {
        var fields = this.getFields(),
            me = this,
            name, field, value, ln, i, f;

        values = values || {};

        for (name in values) {
            if (values.hasOwnProperty(name)) {
                field = fields[name];
                value = values[name];

                if (field) {
                    
                    if (Ext.isArray(field)) {
                        ln = field.length;

                        
                        for (i = 0; i < ln; i++) {
                            f = field[i];

                            if (f.isRadio) {
                                
                                f.setGroupValue(value);
                                break;
                            } else if (f.isCheckbox) {
                                if (Ext.isArray(value)) {
                                   f.setChecked((value.indexOf(f._value) != -1));
                               } else {
                                   f.setChecked((value == f._value));
                               }
                            } else {
                                
                                
                                if (Ext.isArray(value)) {
                                    f.setValue(value[i]);
                                }
                            }
                        }
                    } else {
                        if (field.isRadio || field.isCheckbox) {
                            
                            field.setChecked(value);
                        } else {
                            
                            field.setValue(value);
                        }
                    }

                    if (me.getTrackResetOnLoad()) {
                       field.resetOriginalValue();
                    }
                }
            }
        }

        return this;
    }
function ( values ) { var fields = this . getFields ( ) , me = this , name , field , value , ln , i , f ; values = values || { } ; for ( name in values ) { if ( values . hasOwnProperty ( name ) ) { field = fields [ name ] ; value = values [ name ] ; if ( field ) { // If there are multiple fields with the same name. Checkboxes, radio fields and maybe event just normal fields.. if ( Ext . isArray ( field ) ) { ln = field . length ; // Loop through each of the fields for ( i = 0 ; i < ln ; i ++ ) { f = field [ i ] ; if ( f . isRadio ) { // If it is a radio field just use setGroupValue which will handle all of the radio fields f . setGroupValue ( value ) ; break ; } else if ( f . isCheckbox ) { if ( Ext . isArray ( value ) ) { f . setChecked ( ( value . indexOf ( f . _value ) != - 1 ) ) ; } else { f . setChecked ( ( value == f . _value ) ) ; } } else { // If it is a bunch of fields with the same name, check if the value is also an array, so we can map it // to each field if ( Ext . isArray ( value ) ) { f . setValue ( value [ i ] ) ; } } } } else { if ( field . isRadio || field . isCheckbox ) { // If the field is a radio or a checkbox field . setChecked ( value ) ; } else { // If just a normal field field . setValue ( value ) ; } } if ( me . getTrackResetOnLoad ( ) ) { field . resetOriginalValue ( ) ; } } } } return this ; }
Sets the values of form fields in bulk. Example usage:

myForm.setValues({
name: 'Ed',
crazy: true,
username: 'edspencer'
});

If there groups of checkbox fields with the same name, pass their values in an array. For example:

myForm.setValues({
name: 'Jacky',
crazy: false,
hobbies: [
'reading',
'cooking',
'gaming'
]
});

@param {Object} values field name => value mapping object.
@return {Ext.form.Panel} This form.
Sets the values of form fields in bulk . Example usage :