X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/530ef4b6c5b943cfa68b779d11cf7de29aa878bf..0494b8d9b9bb03ab6c22b34dae81261e3cd7e3e6:/src/widgets/form/Checkbox.js diff --git a/src/widgets/form/Checkbox.js b/src/widgets/form/Checkbox.js index 85f3ce45..b4a8c4ef 100644 --- a/src/widgets/form/Checkbox.js +++ b/src/widgets/form/Checkbox.js @@ -1,8 +1,8 @@ /*! - * Ext JS Library 3.2.1 - * Copyright(c) 2006-2010 Ext JS, Inc. - * licensing@extjs.com - * http://www.extjs.com/license + * Ext JS Library 3.3.1 + * Copyright(c) 2006-2010 Sencha Inc. + * licensing@sencha.com + * http://www.sencha.com/license */ /** * @class Ext.form.Checkbox @@ -35,9 +35,6 @@ Ext.form.Checkbox = Ext.extend(Ext.form.Field, { * {tag: 'input', type: 'checkbox', autocomplete: 'off'}) */ defaultAutoCreate : { tag: 'input', type: 'checkbox', autocomplete: 'off'}, - /** - * @cfg {String} boxLabel The text that appears beside the checkbox - */ /** * @cfg {String} inputValue The value that should go into the generated input element's value attribute */ @@ -118,7 +115,7 @@ Ext.form.Checkbox = Ext.extend(Ext.form.Field, { this.checked = this.el.dom.checked; } // Need to repaint for IE, otherwise positioning is broken - if(Ext.isIE){ + if (Ext.isIE && !Ext.isStrict) { this.wrap.repaint(); } this.resizeEl = this.positionEl = this.wrap; @@ -161,8 +158,10 @@ Ext.form.Checkbox = Ext.extend(Ext.form.Field, { * @return {Ext.form.Field} this */ setValue : function(v){ - var checked = this.checked ; - this.checked = (v === true || v === 'true' || v == '1' || String(v).toLowerCase() == 'on'); + var checked = this.checked, + inputVal = this.inputValue; + + this.checked = (v === true || v === 'true' || v == '1' || (inputVal ? v == inputVal : String(v).toLowerCase() == 'on')); if(this.rendered){ this.el.dom.checked = this.checked; this.el.dom.defaultChecked = this.checked;