Clear Up
SharpKit Reference

Checkbox Class

Namespace: Ext.field

Base Types

System.Object

Constructors

Properties

Name Description
alternateClassName The checkbox field is an enhanced version of the native browser checkbox and is great for enabling your user to choose one or more items from a set (for example choosing toppings for a pizza order). It works like any other {@link Ext.field.Field field} and is usually found in the context of a form: ## Example @example preview var form = Ext.create('Ext.form.Panel', { fullscreen: true, items: [ { xtype: 'checkboxfield', name : 'tomato', label: 'Tomato', value: 'tomato', checked: true }, { xtype: 'checkboxfield', name : 'salami', label: 'Salami' }, { xtype: 'toolbar', docked: 'bottom', items: [ { xtype: 'spacer' }, { text: 'getValues', handler: function() { var form = Ext.ComponentQuery.query('formpanel')[0], values = form.getValues(); Ext.Msg.alert(null, "Tomato: " + ((values.tomato) ? "yes" : "no") + "
Salami: " + ((values.salami) ? "yes" : "no") ); } }, { xtype: 'spacer' } ] } ] }); The form above contains two check boxes - one for Tomato, one for Salami. We configured the Tomato checkbox to be checked immediately on load, and the Salami checkbox to be unchecked. We also specified an optional text {@link #value} that will be sent when we submit the form. We can get this value using the Form's {@link Ext.form.Panel#getValues getValues} function, or have it sent as part of the data that is sent when the form is submitted: form.getValues(); //contains a key called 'tomato' if the Tomato field is still checked form.submit(); //will send 'tomato' in the form submission data
Checked
extend The checkbox field is an enhanced version of the native browser checkbox and is great for enabling your user to choose one or more items from a set (for example choosing toppings for a pizza order). It works like any other {@link Ext.field.Field field} and is usually found in the context of a form: ## Example @example preview var form = Ext.create('Ext.form.Panel', { fullscreen: true, items: [ { xtype: 'checkboxfield', name : 'tomato', label: 'Tomato', value: 'tomato', checked: true }, { xtype: 'checkboxfield', name : 'salami', label: 'Salami' }, { xtype: 'toolbar', docked: 'bottom', items: [ { xtype: 'spacer' }, { text: 'getValues', handler: function() { var form = Ext.ComponentQuery.query('formpanel')[0], values = form.getValues(); Ext.Msg.alert(null, "Tomato: " + ((values.tomato) ? "yes" : "no") + "
Salami: " + ((values.salami) ? "yes" : "no") ); } }, { xtype: 'spacer' } ] } ] }); The form above contains two check boxes - one for Tomato, one for Salami. We configured the Tomato checkbox to be checked immediately on load, and the Salami checkbox to be unchecked. We also specified an optional text {@link #value} that will be sent when we submit the form. We can get this value using the Form's {@link Ext.form.Panel#getValues getValues} function, or have it sent as part of the data that is sent when the form is submitted: form.getValues(); //contains a key called 'tomato' if the Tomato field is still checked form.submit(); //will send 'tomato' in the form submission data
GroupValues Set the status of all matched checkboxes in the same group to checked @param {Array} values An array of values @return {Ext.field.Checkbox} This checkbox
xtype

Methods

Name Description
check() Set the checked state of the checkbox to true @return {Ext.field.Checkbox} This checkbox
doInitValue()
getChecked() Returns the field checked value @return {Mixed} The field value
getGroupValues() Returns an array of values from the checkboxes in the group that are checked, @return {Array}
getSameGroupFields()
getValue()
initialize()
isChecked() Returns the checked state of the checkbox. @return {Boolean} True if checked, else otherwise
onClick(object, object)
onMaskTap(object, object)
reset()
resetGroupValues() Resets the status of all matched checkboxes in the same group to checked @param {Array} values An array of values @return {Ext.field.Checkbox} This checkbox
setChecked(object)
setGroupValues(JsArray) Set the status of all matched checkboxes in the same group to checked @param {Array} values An array of values @return {Ext.field.Checkbox} This checkbox
uncheck() Set the checked state of the checkbox to false @return {Ext.field.Checkbox} This checkbox
updateChecked(object)
© Copyright 2005-2011 SharpKit. All rights reserved.