---
title: "Ext.grid.column.Action"
description: "xtype 为 actioncolumn 的 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.grid.column.Action

源码定义：`ext-all-debug.js:122214`。分类：数据视图、表格与树。

## 创建示例

```javascript
var component = Ext.create("Ext.grid.column.Action", {
  xtype: "actioncolumn",
  actionIconCls: Ext.baseCSSPrefix + 'action-col-icon',
  actionIdRe: new RegExp(Ext.baseCSSPrefix + 'action-col-(\...,
  altText: '',
  disabled: true,
  renderTo: Ext.getBody()
});
```

## 属性

| 属性 | 类型 | 默认值 | 说明 | 配置示例 |
| --- | --- | --- | --- | --- |
| `actionIconCls` | `Mixed` | `Ext.baseCSSPrefix + 'action-col-icon'` | 配置 `actionIconCls` 对应的 CSS 类名。 | `actionIconCls: Ext.baseCSSPrefix + 'action-col-icon'` |
| `actionIdRe` | `Mixed` | `new RegExp(Ext.baseCSSPrefix + 'action-col-(\...` | 配置组件的 `actionIdRe` 选项。 | `actionIdRe: new RegExp(Ext.baseCSSPrefix + 'action-col-(\...` |
| `altText` | `String` | `''` | The alt text to use for the image element. | `altText: ''` |
| `disabled` | `Boolean` | `-` | If true, the action will not respond to click events, and will be displayed semi-opaque. This Column may also be disabled on a row by row basis by configuring a #cfg-isDisabled method. | `disabled: true` |
| `getClass` | `Function` | `-` | A function which returns the CSS class to apply to the icon image. | `getClass: function () {}` |
| `getTip` | `Function` | `-` | A function which returns the tooltip string for any row. | `getTip: function () {}` |
| `handler` | `Function` | `-` | A function called when the icon is clicked. | `handler: function () {}` |
| `icon` | `String` | `-` | The URL of an image to display as the clickable element in the column. There are no default icons that come with Ext JS. Defaults to `Ext#BLANK_IMAGE_URL`. | `icon: "示例值"` |
| `iconCls` | `String` | `-` | A CSS class to apply to the icon image. To determine the class dynamically, configure the Column with a `#getClass` function. There are no default icon classes that come with Ext JS. | `iconCls: "示例值"` |
| `innerCls` | `Mixed` | `Ext.baseCSSPrefix + 'grid-cell-inner-action-col'` | 配置 `innerCls` 对应的 CSS 类名。 | `innerCls: Ext.baseCSSPrefix + 'grid-cell-inner-action-col'` |
| `isDisabled` | `Function` | `-` | A function which determines whether the action item for any row is disabled and returns `true` or `false`. | `isDisabled: function () {}` |
| `items` | `Object[]` | `-` | An Array which may contain multiple icon definitions, each element of which may contain: | `items: { /* 配置 */ }` |
| `menuText` | `String` | `Str.actions1` | =Actions] Text to display in this column's menu item if no #text was specified as a header. | `menuText: Str.actions1` |
| `scope` | `Object` | `-` | The scope (`this` reference) in which the `#handler`, `#getClass`, `#cfg-isDisabled` and `#getTip` fuctions are executed. Defaults to this Column. | `scope: { /* 配置 */ }` |
| `sortable` | `Boolean` | `false` | 控制表格列是否允许排序。 | `sortable: false` |
| `stopSelection` | `Boolean` | `true` | =true] Prevent grid selection upon click. Beware that if you allow for the selection to happen then the selection model will steal focus from any possible floating window (like a message box) raised in the handler. This will prevent closing the window when pressing the Escape button since it will no longer contain a focused component. | `stopSelection: true` |
| `tooltip` | `String` | `-` | A tooltip message to be displayed on hover. Ext.tip.QuickTipManager#init must have been initialized. The tooltip may also be determined on a row by row basis by configuring a #getTip method. | `tooltip: "示例值"` |

## 方法

| 方法 | 参数 | 说明 | 调用示例 |
| --- | --- | --- | --- |
| `defaultRenderer` | `v, meta, record, rowIdx, colIdx, store, view` | 生成 `default` 的渲染结果。 | `component.defaultRenderer(...)` |
| `enableAction` | `index, silent` | 启用 `action`。 执行时会派发 `enable` 事件。源码涉及 `up()`、`fireEvent()`。 | `component.enableAction(...)` |
| `disableAction` | `index, silent` | 禁用 `action`。 执行时会派发 `disable` 事件。源码涉及 `up()`、`fireEvent()`。 | `component.disableAction(...)` |
| `destroy` | `` | 销毁组件并释放关联资源。 执行时会保留父类默认行为。源码涉及 `callParent()`。 | `component.destroy()` |
| `processEvent` | `type, view, cell, recordIndex, cellIndex, e, record, row` | 处理 `event`。 执行时会保留父类默认行为。源码涉及 `callParent()`。 | `component.processEvent(...)` |
| `cascade` | `fn, scope` | 处理 `cascade` 操作。 | `component.cascade(...)` |
| `getRefItems` | `` | 读取并返回 `refItems`。 | `component.getRefItems()` |

## 事件

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

Source: https://ag.879818327.xyz/ext/data/grid-column-action/index.mdx
