X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6a7e4474cba9d8be4b2ec445e10f1691f7277c50..7a654f8d43fdb43d78b63d90528bed6e86b608cc:/src/widgets/form/Checkbox.js diff --git a/src/widgets/form/Checkbox.js b/src/widgets/form/Checkbox.js deleted file mode 100644 index 3fd2ce70..00000000 --- a/src/widgets/form/Checkbox.js +++ /dev/null @@ -1,179 +0,0 @@ -/*! - * Ext JS Library 3.2.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. - * @constructor - * Creates a new Checkbox - * @param {Object} config Configuration options - * @xtype checkbox - */ -Ext.form.Checkbox = Ext.extend(Ext.form.Field, { - /** - * @cfg {String} focusClass The CSS class to use when the checkbox receives focus (defaults to undefined) - */ - focusClass : undefined, - /** - * @cfg {String} fieldClass The default CSS class for the checkbox (defaults to 'x-form-field') - */ - fieldClass : 'x-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'}) - */ - 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 - */ - /** - * @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: - *
{@link #handler}
(if configured).
- * @param {Boolean/String} checked The following values will check the checkbox:
- * true, 'true', '1', or 'on'
. Any other value will uncheck the checkbox.
- * @return {Ext.form.Field} this
- */
- setValue : function(v){
- var checked = this.checked ;
- this.checked = (v === true || v === 'true' || v == '1' || String(v).toLowerCase() == 'on');
- if(this.rendered){
- this.el.dom.checked = this.checked;
- this.el.dom.defaultChecked = this.checked;
- }
- if(checked != this.checked){
- this.fireEvent('check', this, this.checked);
- if(this.handler){
- this.handler.call(this.scope || this, this, this.checked);
- }
- }
- return this;
- }
-});
-Ext.reg('checkbox', Ext.form.Checkbox);