X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6e39d509471fe9b4e2660e0d1631b350d0c66f40..f5240829880f87e0cf581c6a296e436fdef0ef80:/docs/source/Checkbox.html diff --git a/docs/source/Checkbox.html b/docs/source/Checkbox.html index d7afa1a0..29c848df 100644 --- a/docs/source/Checkbox.html +++ b/docs/source/Checkbox.html @@ -1,12 +1,18 @@ - -
- -/** + + + +The source code + + + + +/*! + * Ext JS Library 3.3.0 + * Copyright(c) 2006-2010 Ext JS, Inc. + * licensing@extjs.com + * http://www.extjs.com/license + */ +/** * @class Ext.form.Checkbox * @extends Ext.form.Field * Single checkbox field. Can be used as a direct replacement for traditional checkbox fields. @@ -28,6 +34,10 @@ Ext.form.Checkbox = Ext.extend(Ext.form.Field, { * @cfg {Boolean} checked true if the checkbox should render initially checked (defaults to false) */ checked : false, + /** + * @cfg {String} boxLabel The text that appears beside the checkbox + */ + boxLabel: ' ', /** * @cfg {String/Object} autoCreate A DomHelper element spec, or true for a default element spec (defaults to * {tag: 'input', type: 'checkbox', autocomplete: 'off'}) @@ -40,7 +50,7 @@ Ext.form.Checkbox = Ext.extend(Ext.form.Field, { * @cfg {String} inputValue The value that should go into the generated input element's value attribute */ /** - * @cfg {Function} handler A function called when the {@link #checked} value changes (can be used instead of + * @cfg {Function} handler A function called when the {@link #checked} value changes (can be used instead of * handling the check event). The handler is passed the following parameters: **
- checkbox : Ext.form.Checkbox
@@ -54,7 +64,7 @@ Ext.form.Checkbox = Ext.extend(Ext.form.Field, { // private actionMode : 'wrap', - + // private initComponent : function(){ Ext.form.Checkbox.superclass.initComponent.call(this); @@ -116,13 +126,10 @@ 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; - if(Ext.isEmpty(this.boxLabel)){ - this.el.addClass('x-form-check-nolabel'); - } }, // private @@ -162,8 +169,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; @@ -178,6 +187,6 @@ Ext.form.Checkbox = Ext.extend(Ext.form.Field, { } }); Ext.reg('checkbox', Ext.form.Checkbox); - - + + \ No newline at end of fileThe Checkbox being toggled.