Clear Up
SharpKit Reference

Radio Class

Namespace: Ext.field

Base Types

System.Object

Constructors

Name Description
Radio()

Properties

Name Description
alias The radio field is an enhanced version of the native browser radio controls and is a good way of allowing your user to choose one option out of a selection of several (for example, choosing a favorite color): var form = Ext.create('Ext.form.Panel', { items: [ { xtype: 'radiofield', name : 'color', value: 'red', label: 'Red', checked: true }, { xtype: 'radiofield', name : 'color', value: 'green', label: 'Green' }, { xtype: 'radiofield', name : 'color', value: 'blue', label: 'Blue' } ] }); Above we created a simple form which allows the user to pick a color from the options red, green and blue. Because we gave each of the fields above the same {@link #name}, the radio field ensures that only one of them can be checked at a time. When we come to get the values out of the form again or submit it to the server, only 1 value will be sent for each group of radio fields with the same name: form.getValues(); //looks like {color: 'red'} form.submit(); //sends a single field back to the server (in this case color: red)
alternateClassName
extend The radio field is an enhanced version of the native browser radio controls and is a good way of allowing your user to choose one option out of a selection of several (for example, choosing a favorite color): var form = Ext.create('Ext.form.Panel', { items: [ { xtype: 'radiofield', name : 'color', value: 'red', label: 'Red', checked: true }, { xtype: 'radiofield', name : 'color', value: 'green', label: 'Green' }, { xtype: 'radiofield', name : 'color', value: 'blue', label: 'Blue' } ] }); Above we created a simple form which allows the user to pick a color from the options red, green and blue. Because we gave each of the fields above the same {@link #name}, the radio field ensures that only one of them can be checked at a time. When we come to get the values out of the form again or submit it to the server, only 1 value will be sent for each group of radio fields with the same name: form.getValues(); //looks like {color: 'red'} form.submit(); //sends a single field back to the server (in this case color: red)
GroupValue Set the matched radio field's status (that has the same value as the given string) to checked @param {String} value The value of the radio field to check @return {String}

Methods

Name Description
getGroupValue() Returns the selected value if this radio is part of a group (other radio fields with the same name, in the same FormPanel), @return {String}
setGroupValue(JsString) Set the matched radio field's status (that has the same value as the given string) to checked @param {String} value The value of the radio field to check @return {String}
© Copyright 2005-2011 SharpKit. All rights reserved.