radio.js
来自「EXT2.0的中文API源代码」· JavaScript 代码 · 共 37 行
JS
37 行
/** * @class Ext.form.Radio * @extends Ext.form.Checkbox * 单个的radio按钮。与Checkbox类似,提供一种简便,自动的输入方式。 * 如果你给radio按钮组中的每个按钮相同的名字(属性name值相同),按钮组会自动被浏览器获得。 * @constructor * 创建一个新的radio按钮对象 * @param {Object} config 配置选项 *//** * @class Ext.form.Radio * @extends Ext.form.Checkbox * Single radio field. Same as Checkbox, but provided as a convenience for automatically setting the input type. * Radio grouping is handled automatically by the browser if you give each radio in a group the same name. * @constructor * Creates a new Radio * @param {Object} config Configuration options */Ext.form.Radio = function(){ Ext.form.Radio.superclass.constructor.apply(this, arguments);};Ext.extend(Ext.form.Radio, Ext.form.Checkbox, { inputType: 'radio', /** * 如果该radio是组的一部分,将返回已选中的值。 * @return {String} */ /** * If this radio is part of a group, it will return the selected value * @return {String} */ getGroupValue : function(){ return this.el.up('form').child('input[name='+this.el.dom.name+']:checked', true).value; }});Ext.reg('radio', Ext.form.Radio);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?