- if(arguments.length == 1){
- if(Ext.isArray(id)){
- //an array of boolean values
- Ext.each(id, function(val, idx){
+ this.onSetValue.apply(this, arguments);
+ }else{
+ this.buffered = true;
+ this.value = arguments;
+ }
+ return this;
+ },
+
+ /**
+ * @private
+ * Sets the values of one or more of the items within the CheckboxGroup
+ * @param {String|Array|Object} id Can take multiple forms. Can be optionally:
+ * <ul>
+ * <li>An ID string to be used with a second argument</li>
+ * <li>An array of the form ['some', 'list', 'of', 'ids', 'to', 'mark', 'checked']</li>
+ * <li>An array in the form [true, true, false, true, false] etc, where each item relates to the check status of
+ * the checkbox at the same index</li>
+ * <li>An object containing ids of the checkboxes as keys and check values as properties</li>
+ * </ul>
+ * @param {String} value The value to set the field to if the first argument was a string
+ */
+ onSetValue: function(id, value){
+ if(arguments.length == 1){
+ if(Ext.isArray(id)){
+ Ext.each(id, function(val, idx){
+ if (Ext.isObject(val) && val.setValue){ // array of checkbox components to be checked
+ val.setValue(true);
+ if (this.resetOriginal === true) {
+ val.originalValue = val.getValue();
+ }
+ } else { // an array of boolean values