---
title: "Ext.form.RadioGroup"
description: "xtype 为 radiogroup 的 Ext JS 原生组件参考。"
---

> Documentation Index
> Fetch the complete documentation index at: https://ag.879818327.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Ext.form.RadioGroup

源码定义：`ext-all-debug.js:99065`。分类：表单与字段。

## 创建示例

```javascript
var component = Ext.create("Ext.form.RadioGroup", {
  xtype: "radiogroup",
  allowBlank: true,
  ariaRole: 'radiogroup',
  blankText: 'You must select one item in this group',
  defaultType: 'radiofield',
  renderTo: Ext.getBody()
});
```

## 属性

| 属性 | 类型 | 默认值 | 说明 | 配置示例 |
| --- | --- | --- | --- | --- |
| `allowBlank` | `Boolean` | `true` | 控制字段是否允许为空。 | `allowBlank: true` |
| `ariaRole` | `String` | `'radiogroup'` | 组件在辅助技术中的 ARIA 角色。 | `ariaRole: 'radiogroup'` |
| `blankText` | `String` | `'You must select one item in this group'` | 配置组件的 `blankText` 选项。 | `blankText: 'You must select one item in this group'` |
| `defaultType` | `String` | `'radiofield'` | 配置组件的 `defaultType` 选项。 | `defaultType: 'radiofield'` |
| `groupCls` | `Mixed` | `Ext.baseCSSPrefix + 'form-radio-group'` | 配置 `groupCls` 对应的 CSS 类名。 | `groupCls: Ext.baseCSSPrefix + 'form-radio-group'` |

## 方法

| 方法 | 参数 | 说明 | 调用示例 |
| --- | --- | --- | --- |
| `getBoxes` | `query` | 读取并返回 `boxes`。源码涉及 `query()`。 | `component.getBoxes(...)` |
| `getValue` | `` | 读取并返回 `value`。源码涉及 `getBoxes()`。 | `component.getValue()` |
| `getTextValue` | `` | 读取并返回 `textValue`。源码涉及 `getBoxes()`。 | `component.getTextValue()` |
| `setValue` | `value` | 设置 `value`。源码涉及 `getBoxes()`、`batchChanges()`。 | `component.setValue(...)` |
| `isEqual` | `value1, value2` | 判断 `equal` 状态。 | `component.isEqual(...)` |

## 事件

源码中未找到该组件自身注册的事件；可监听继承事件。

Source: https://ag.879818327.xyz/ext/form/form-radiogroup/index.mdx
