---
title: "Ext.menu.ColorPicker"
description: "xtype 为 colormenu 的 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.menu.ColorPicker

源码定义：`ext-all-debug.js:137515`。分类：按钮、工具栏、菜单与标签页。

## 创建示例

```javascript
var component = Ext.create("Ext.menu.ColorPicker", {
  xtype: "colormenu",
  hideOnClick: true,
  pickerId: null,
  renderTo: Ext.getBody()
});
```

## 属性

| 属性 | 类型 | 默认值 | 说明 | 配置示例 |
| --- | --- | --- | --- | --- |
| `hideOnClick` | `Boolean` | `true` | 控制是否隐藏 `onClick`。 | `hideOnClick: true` |
| `pickerId` | `Object/null` | `null` | 配置组件的 `pickerId` 选项。 | `pickerId: null` |

## 方法

| 方法 | 参数 | 说明 | 调用示例 |
| --- | --- | --- | --- |
| `initComponent` | `` | 初始化组件及其子项。 执行时会保留父类默认行为、更新 `picker` 状态。源码涉及 `callParent()`、`down()`、`relayEvents()`、`on()`。 | `component.initComponent()` |
| `hidePickerOnSelect` | `` | 隐藏 `pickerOnSelect`。 | `component.hidePickerOnSelect()` |

## 事件

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

Source: https://ag.879818327.xyz/ext/navigation/menu-colorpicker/index.mdx
