syncfusion-angular-ribbon
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSyncfusion Angular Ribbon Component
Syncfusion Angular Ribbon 组件
Component Overview
组件概述
The Syncfusion Angular Ribbon is a professional command interface component that organizes application commands in a tabbed ribbon format, similar to Microsoft Office. It features:
- Hierarchical Command Organization: Tabs → Groups → Collections → Items for logical command structure
- 7 Built-in Item Types: Button, CheckBox, DropDown, SplitButton, ComboBox, ColorPicker, GroupButton, and Gallery
- Dual Layout Modes: Classic (multi-row) and Simplified (collapsible) layouts with automatic resizing
- File Menu & Backstage Views: Traditional file menus or modern backstage interfaces for document operations
- Contextual Tabs: Dynamic tabs that appear based on user selection or context
- Responsive Resizing: Automatic item size adjustment (Large, Medium, Small) based on available width
- Keyboard Navigation: Full keytips support for keyboard-first workflows
- Accessibility Features: WCAG compliance with ARIA attributes and screen reader support
- RTL Support: Right-to-left layout for Arabic, Hebrew, Persian, and Urdu languages
- Gallery Items: Visual selection panels for themes, styles, and color schemes
- Help Pane: Customizable help pane with template support
- Advanced Event System: Comprehensive events for tab selection, collapse/expand, launcher clicks, and item interactions
- Highly Configurable: Extensive API with 20+ ribbon properties, 30+ item properties, and 10+ events
Syncfusion Angular Ribbon 是一款专业的命令界面组件,它以选项卡式功能区格式组织应用命令,与Microsoft Office的界面风格类似。其特性包括:
- 层级化命令组织:选项卡 → 组 → 集合 → 项的逻辑命令结构
- 7种内置项类型:Button、CheckBox、DropDown、SplitButton、ComboBox、ColorPicker、GroupButton和Gallery
- 双布局模式:经典(多行)布局和简化(可折叠)布局,支持自动调整大小
- 文件菜单与后台视图:用于文档操作的传统文件菜单或现代后台界面
- 上下文选项卡:根据用户选择或上下文动态显示的选项卡
- 响应式调整:根据可用宽度自动调整项的尺寸(大、中、小)
- 键盘导航:全面的快捷键支持,适配优先使用键盘的工作流
- 无障碍特性:符合WCAG标准,支持ARIA属性和屏幕阅读器
- RTL支持:适用于阿拉伯语、希伯来语、波斯语和乌尔都语的从右到左布局
- Gallery项:用于主题、样式和配色方案的可视化选择面板
- 帮助面板:支持模板自定义的可配置帮助面板
- 高级事件系统:涵盖选项卡选择、折叠/展开、启动器点击和项交互的全面事件
- 高度可配置:丰富的API,包含20+个功能区属性、30+个项属性和10+个事件
Key Concepts & Hierarchy
核心概念与层级结构
Important concepts:
- Tabs: Organize major feature categories (Home, Insert, View)
- Groups: Group related commands within a tab (Clipboard, Font, Alignment)
- Collections: Visual groupings within a group for better organization
- Items: Individual commands with 7 types (Button, DropDown, ColorPicker, etc.)
- Layouts: Classic (multi-row) or Simplified (collapse-capable) with automatic switching
- File Menu/Backstage: Application-level operations (New, Open, Save, Print)
重要概念:
- 选项卡(Tabs):组织主要功能类别(如开始、插入、视图)
- 组(Groups):在选项卡内对相关命令进行分组(如剪贴板、字体、对齐)
- 集合(Collections):在组内进行可视化分组,优化组织性
- 项(Items):7种类型的单个命令(Button、DropDown、ColorPicker等)
- 布局(Layouts):经典(多行)或简化(可折叠)布局,支持自动切换
- 文件菜单/后台(File Menu/Backstage):应用级操作(新建、打开、保存、打印)
Documentation and Navigation Guide
文档与导航指南
Getting Started
快速入门
📄 Read: references/getting-started.md
- Installation and package setup (Ivy vs ngcc)
- CSS theme imports and dependencies
- Creating your first Ribbon
- Adding tabs and groups
- Basic items and running the application
📄 阅读:references/getting-started.md
- 安装与包设置(Ivy vs ngcc)
- CSS主题导入与依赖
- 创建你的第一个Ribbon
- 添加选项卡和组
- 基础项配置与应用运行
Tabs, Groups, and Items Structure
选项卡、组与项的结构
📄 Read: references/tabs-groups-items.md
- Tab hierarchy and properties
- Adding groups to tabs
- Ribbon collections and items
- Item size configuration (Large, Medium, Small)
- Orientation settings (Row/Column)
- Multiple tabs and groups examples
📄 阅读:references/tabs-groups-items.md
- 选项卡层级与属性
- 为选项卡添加组
- Ribbon集合与项
- 项尺寸配置(大、中、小)
- 方向设置(行/列)
- 多选项卡与组示例
Item Types and Configuration
项类型与配置
📄 Read: references/item-types.md
- All 7 built-in item types
- Button items (toggle, disabled states)
- CheckBox, DropDown, SplitButton items
- ComboBox, ColorPicker, GroupButton items
- Complete code examples for each type
- Item settings models and properties
📄 阅读:references/item-types.md
- 所有7种内置项类型
- Button项(切换、禁用状态)
- CheckBox、DropDown、SplitButton项
- ComboBox、ColorPicker、GroupButton项
- 每种类型的完整代码示例
- 项设置模型与属性
Ribbon Layouts and Resizing
Ribbon布局与调整大小
📄 Read: references/layouts.md
- Classic layout (default multi-row format)
- Simplified layout (with collapse support)
- Switching between layouts
- Item size allowances and configuration
- Responsive resizing behavior
- Layout examples and best practices
📄 阅读:references/layouts.md
- 经典布局(默认多行格式)
- 简化布局(支持折叠)
- 布局切换
- 项尺寸允许范围与配置
- 响应式调整行为
- 布局示例与最佳实践
File Menu and Backstage Views
文件菜单与后台视图
📄 Read: references/file-menu-and-backstage.md
- File Menu configuration and visibility
- Adding menu items with icons and actions
- Backstage view as file menu replacement
- Backstage items and content
- Footer items and separators
- Back button customization
- Target element positioning
- Complete file menu and backstage examples
📄 阅读:references/file-menu-and-backstage.md
- 文件菜单配置与可见性
- 添加带图标和操作的菜单项
- 用后台视图替代文件菜单
- 后台项与内容
- 页脚项与分隔符
- 返回按钮自定义
- 目标元素定位
- 完整的文件菜单与后台示例
Advanced Features
高级特性
📄 Read: references/advanced-features.md
- Contextual tabs (dynamic tab creation)
- Keytips for keyboard navigation
- Gallery items for visual selection
- Help pane templates
- Tooltip configuration
- Resizing behavior and responsive design
- RTL support for right-to-left languages
- Accessibility features and WCAG compliance
📄 阅读:references/advanced-features.md
- 上下文选项卡(动态创建选项卡)
- 键盘导航快捷键
- 用于可视化选择的Gallery项
- 帮助面板模板
- 提示框配置
- 调整大小行为与响应式设计
- RTL从右到左布局支持
- 无障碍特性与WCAG合规性
Events and Interactivity
事件与交互
📄 Read: references/events.md
- Tab selection events (tabSelected, tabSelecting)
- Ribbon collapse/expand events
- Backstage item click events
- Event arguments and cancellation
- Event handling patterns
- Complete event examples
📄 阅读:references/events.md
- 选项卡选择事件(tabSelected、tabSelecting)
- Ribbon折叠/展开事件
- 后台项点击事件
- 事件参数与取消操作
- 事件处理模式
- 完整的事件示例
Customization and Styling
自定义与样式
📄 Read: references/customization-and-styling.md
- CSS class customization
- Theme integration and switching
- CSS variables for styling
- Custom styling examples
- Group icon customization
- Item customization and appearance
- Launcher icon usage
📄 阅读:references/customization-and-styling.md
- CSS类自定义
- 主题集成与切换
- 用于样式的CSS变量
- 自定义样式示例
- 组图标自定义
- 项自定义与外观设置
- 启动器图标使用
Quick Start Example
快速入门示例
Here's a minimal Ribbon with Home and Insert tabs:
typescript
import { Component } from "@angular/core";
import { RibbonModule } from '@syncfusion/ej2-angular-ribbon';
import { RibbonButtonSettingsModel, RibbonSplitButtonSettingsModel } from '@syncfusion/ej2-angular-ribbon';
@Component({
imports: [ RibbonModule ],
standalone: true,
selector: "app-root",
template: `
<ejs-ribbon id="ribbon">
<e-ribbon-tabs>
<e-ribbon-tab header="Home">
<e-ribbon-groups>
<e-ribbon-group header="Clipboard" orientation="Row">
<e-ribbon-collections>
<e-ribbon-collection>
<e-ribbon-items>
<e-ribbon-item type="SplitButton" [splitButtonSettings]="pasteSettings"></e-ribbon-item>
</e-ribbon-items>
</e-ribbon-collection>
<e-ribbon-collection>
<e-ribbon-items>
<e-ribbon-item type="Button" [buttonSettings]="cutButton"></e-ribbon-item>
<e-ribbon-item type="Button" [buttonSettings]="copyButton"></e-ribbon-item>
</e-ribbon-items>
</e-ribbon-collection>
</e-ribbon-collections>
</e-ribbon-group>
</e-ribbon-groups>
</e-ribbon-tab>
<e-ribbon-tab header="Insert">
<e-ribbon-groups>
<e-ribbon-group header="Illustrations" orientation="Row">
<e-ribbon-collections>
<e-ribbon-collection>
<e-ribbon-items>
<e-ribbon-item type="Button" [buttonSettings]="chartButton"></e-ribbon-item>
</e-ribbon-items>
</e-ribbon-collection>
</e-ribbon-collections>
</e-ribbon-group>
</e-ribbon-groups>
</e-ribbon-tab>
</e-ribbon-tabs>
</ejs-ribbon>
`,
styleUrls: ['./app.component.css']
})
export class AppComponent {
public pasteSettings = {
iconCss: "e-icons e-paste",
items: [{ text: "Keep Source Format" }, { text: "Merge format" }],
content: "Paste"
};
public cutButton: RibbonButtonSettingsModel = { iconCss: "e-icons e-cut", content: "Cut" };
public copyButton: RibbonButtonSettingsModel = { iconCss: "e-icons e-copy", content: "Copy" };
public chartButton: RibbonButtonSettingsModel = { iconCss: "e-icons e-chart", content: "Chart" };
}以下是一个包含“开始”和“插入”选项卡的极简Ribbon:
typescript
import { Component } from "@angular/core";
import { RibbonModule } from '@syncfusion/ej2-angular-ribbon';
import { RibbonButtonSettingsModel, RibbonSplitButtonSettingsModel } from '@syncfusion/ej2-angular-ribbon';
@Component({
imports: [ RibbonModule ],
standalone: true,
selector: "app-root",
template: `
<ejs-ribbon id="ribbon">
<e-ribbon-tabs>
<e-ribbon-tab header="Home">
<e-ribbon-groups>
<e-ribbon-group header="Clipboard" orientation="Row">
<e-ribbon-collections>
<e-ribbon-collection>
<e-ribbon-items>
<e-ribbon-item type="SplitButton" [splitButtonSettings]="pasteSettings"></e-ribbon-item>
</e-ribbon-items>
</e-ribbon-collection>
<e-ribbon-collection>
<e-ribbon-items>
<e-ribbon-item type="Button" [buttonSettings]="cutButton"></e-ribbon-item>
<e-ribbon-item type="Button" [buttonSettings]="copyButton"></e-ribbon-item>
</e-ribbon-items>
</e-ribbon-collection>
</e-ribbon-collections>
</e-ribbon-group>
</e-ribbon-groups>
</e-ribbon-tab>
<e-ribbon-tab header="Insert">
<e-ribbon-groups>
<e-ribbon-group header="Illustrations" orientation="Row">
<e-ribbon-collections>
<e-ribbon-collection>
<e-ribbon-items>
<e-ribbon-item type="Button" [buttonSettings]="chartButton"></e-ribbon-item>
</e-ribbon-items>
</e-ribbon-collection>
</e-ribbon-collections>
</e-ribbon-group>
</e-ribbon-groups>
</e-ribbon-tab>
</e-ribbon-tabs>
</ejs-ribbon>
`,
styleUrls: ['./app.component.css']
})
export class AppComponent {
public pasteSettings = {
iconCss: "e-icons e-paste",
items: [{ text: "Keep Source Format" }, { text: "Merge format" }],
content: "Paste"
};
public cutButton: RibbonButtonSettingsModel = { iconCss: "e-icons e-cut", content: "Cut" };
public copyButton: RibbonButtonSettingsModel = { iconCss: "e-icons e-copy", content: "Copy" };
public chartButton: RibbonButtonSettingsModel = { iconCss: "e-icons e-chart", content: "Chart" };
}Common Patterns
常见模式
Pattern 1: Multi-Tab Command Interface
模式1:多选项卡命令界面
- Define multiple tabs for major features (Home, Insert, View, Format)
- Add groups within each tab for related commands
- Configure collections to organize items visually
- Use appropriate item types (Button, DropDown, ColorPicker)
- Set to Classic or Simplified
activeLayout - Handle event for tab-specific actions
tabSelected
- 为主要功能定义多个选项卡(开始、插入、视图、格式)
- 在每个选项卡内添加相关命令的组
- 配置集合以可视化组织项
- 使用合适的项类型(Button、DropDown、ColorPicker)
- 将设置为Classic或Simplified
activeLayout - 处理事件以实现选项卡特定操作
tabSelected
Pattern 2: File Menu Integration with Backstage
模式2:集成文件菜单与后台视图
- Configure or
fileMenufor document operationsbackStageMenu - Add menu items for New, Open, Save, Print, Export
- Set icons with and content areas for backstage
iconCss - Handle menu item clicks with event handlers
- Use footer items for settings or account options
- Configure back button for backstage navigation
- 配置或
fileMenu用于文档操作backStageMenu - 添加新建、打开、保存、打印、导出等菜单项
- 使用设置图标,并为后台视图配置内容区域
iconCss - 通过事件处理程序处理菜单项点击
- 使用页脚项设置或账户相关选项
- 配置后台视图的返回按钮
Pattern 3: Responsive Resizing with Size Priorities
模式3:带尺寸优先级的响应式调整
- Set array on items (Large, Medium, Small)
allowedSizes - Configure for initial display size
activeSize - Ribbon automatically adjusts item sizes based on width
- Use for primary commands,
Largefor secondarySmall - Handle event for custom resize logic
ribbonCollapsing - Test responsive behavior at different viewport widths
- 为项设置数组(大、中、小)
allowedSizes - 配置设置初始显示尺寸
activeSize - Ribbon会根据宽度自动调整项的尺寸
- 主要命令使用“大”尺寸,次要命令使用“小”尺寸
- 处理事件实现自定义调整逻辑
ribbonCollapsing - 在不同视口宽度下测试响应式行为
Pattern 4: Contextual Tabs for Dynamic Commands
模式4:用于动态命令的上下文选项卡
- Define array with tab configurations
contextualTabs - Set property based on user selection or context
visible - Use to activate contextual tab programmatically
isSelected - Add tab-specific groups and items for contextual commands
- Handle to detect contextual tab activation
tabSelected - Toggle visibility dynamically in response to user actions
- 定义包含选项卡配置的数组
contextualTabs - 根据用户选择或上下文设置属性
visible - 使用以编程方式激活上下文选项卡
isSelected - 为上下文命令添加选项卡特定的组和项
- 处理事件检测上下文选项卡的激活
tabSelected - 根据用户操作动态切换可见性
Pattern 5: Keyboard Navigation with Keytips
模式5:带快捷键的键盘导航
- Enable on ribbon component
enableKeyTips - Assign property to tabs (Alt+H for Home)
keyTip - Add keytips to groups and individual items
- Configure for layout toggle
layoutSwitcherKeyTip - Set keytips on file menu and backstage items
- Follow consistent keytip patterns (Alt+ letter combinations)
- 在Ribbon组件上启用
enableKeyTips - 为选项卡分配属性(如Home选项卡为Alt+H)
keyTip - 为组和单个项添加快捷键
- 为布局切换器配置
layoutSwitcherKeyTip - 为文件菜单和后台项设置快捷键
- 遵循一致的快捷键模式(Alt+字母组合)
Pattern 6: Gallery Items for Visual Selection
模式6:用于可视化选择的Gallery项
- Configure items with for visual panels
type="Gallery" - Define with groups and items
gallerySettings - Set ,
itemCount,popupWidthfor displaypopupHeight - Use templates for custom gallery item rendering
- Handle selection events for gallery item clicks
- Common use cases: themes, styles, colors, table designs
- 将项配置为以实现可视化面板
type="Gallery" - 定义包含组和项的
gallerySettings - 设置、
itemCount、popupWidth以配置显示效果popupHeight - 使用模板自定义Gallery项的渲染
- 处理Gallery项点击的选择事件
- 常见应用场景:主题、样式、颜色、表格设计
Key Properties & Events
核心属性与事件
Core Ribbon Configuration
Ribbon核心配置
| Property | Type | Default | When to Use |
|---|---|---|---|
| RibbonTabModel[] | | Define ribbon tabs with groups and items |
| LayoutType | | Set layout mode (Classic or Simplified) |
| number | | Set or get the currently active tab index |
| boolean | | Control ribbon minimized state |
| 属性 | 类型 | 默认值 | 适用场景 |
|---|---|---|---|
| RibbonTabModel[] | | 定义包含组和项的Ribbon选项卡 |
| LayoutType | | 设置布局模式(经典或简化) |
| number | | 设置或获取当前激活的选项卡索引 |
| boolean | | 控制Ribbon的最小化状态 |
Layout & Appearance
布局与外观
| Property | Type | Default | When to Use |
|---|---|---|---|
| string | number | | Set ribbon container width |
| string | | Apply custom CSS classes for styling and themes |
| boolean | | Hide the Classic/Simplified layout toggle button |
| object | | Configure tab switching animation settings |
| 属性 | 类型 | 默认值 | 适用场景 |
|---|---|---|---|
| string | number | | 设置Ribbon容器宽度 |
| string | | 应用自定义CSS类进行样式和主题设置 |
| boolean | | 隐藏经典/简化布局切换按钮 |
| object | | 配置选项卡切换动画设置 |
Keyboard & Accessibility
键盘与无障碍
| Property | Type | Default | When to Use |
|---|---|---|---|
| boolean | | Enable keytips for keyboard navigation (Alt+ shortcuts) |
| string | | Set keytip for layout switcher button |
| string | | Default CSS class for launcher icons across all groups |
| 属性 | 类型 | 默认值 | 适用场景 |
|---|---|---|---|
| boolean | | 启用键盘导航快捷键(Alt+快捷方式) |
| string | | 为布局切换器按钮设置快捷键 |
| string | | 为所有组的启动器图标设置默认CSS类 |
File Menu & Backstage
文件菜单与后台视图
| Property | Type | Default | When to Use |
|---|---|---|---|
| FileMenuSettingsModel | | Configure traditional file menu (New, Open, Save, Print) |
| BackStageMenuModel | | Configure modern backstage view (replaces file menu) |
| 属性 | 类型 | 默认值 | 适用场景 |
|---|---|---|---|
| FileMenuSettingsModel | | 配置传统文件菜单(新建、打开、保存、打印) |
| BackStageMenuModel | | 配置现代后台视图(替代文件菜单) |
Advanced Features
高级特性
| Property | Type | Default | When to Use |
|---|---|---|---|
| RibbonContextualTabModel[] | | Define tabs that appear based on context or selection |
| string | | Custom template for help pane content |
| 属性 | 类型 | 默认值 | 适用场景 |
|---|---|---|---|
| RibbonContextualTabModel[] | | 定义根据上下文或选择显示的选项卡 |
| string | | 帮助面板内容的自定义模板 |
Globalization
全球化
| Property | Type | Default | When to Use |
|---|---|---|---|
| string | | Set language/culture for localization |
| boolean | | Enable right-to-left layout (Arabic, Hebrew, Persian, Urdu) |
| boolean | | Save ribbon state between page reloads |
| 属性 | 类型 | 默认值 | 适用场景 |
|---|---|---|---|
| string | | 设置本地化的语言/区域 |
| boolean | | 启用从右到左布局(阿拉伯语、希伯来语、波斯语、乌尔都语) |
| boolean | | 在页面重载之间保存Ribbon状态 |
Tab Configuration
选项卡配置
| Property | Type | Default | When to Use |
|---|---|---|---|
| string | | Tab display text (Home, Insert, View) |
| RibbonGroupModel[] | | Array of groups within the tab |
| string | | Unique identifier for the tab |
| string | | Keyboard shortcut keytip (H for Home) |
| 属性 | 类型 | 默认值 | 适用场景 |
|---|---|---|---|
| string | | 选项卡显示文本(如开始、插入、视图) |
| RibbonGroupModel[] | | 选项卡内的组数组 |
| string | | 选项卡的唯一标识符 |
| string | | 选项卡的键盘快捷键(如Home选项卡为H) |
Group Configuration
组配置
| Property | Type | Default | When to Use |
|---|---|---|---|
| string | | Group display text (Clipboard, Font, Alignment) |
| ItemOrientation | | Layout direction (Row or Column) |
| boolean | | Show overflow dropdown when group doesn't fit |
| boolean | | Allow group to collapse in simplified layout |
| boolean | | Show launcher icon for dialog/pane launch |
| string | | CSS class for group icon in overflow/launcher |
| 属性 | 类型 | 默认值 | 适用场景 |
|---|---|---|---|
| string | | 组显示文本(如剪贴板、字体、对齐) |
| ItemOrientation | | 布局方向(行或列) |
| boolean | | 当组无法容纳时显示溢出下拉菜单 |
| boolean | | 允许组在简化布局中折叠 |
| boolean | | 显示用于启动对话框/面板的启动器图标 |
| string | | 溢出/启动器中组图标的CSS类 |
Item Configuration
项配置
| Property | Type | Default | When to Use |
|---|---|---|---|
| RibbonItemType | | Item type: Button, CheckBox, DropDown, SplitButton, ComboBox, ColorPicker, GroupButton, Gallery |
| string | | Unique identifier for the item |
| RibbonItemSize[] | | Sizes item can resize to (responsive behavior) |
| RibbonItemSize | | Current display size of item |
| boolean | | Disable item to prevent user interaction |
| DisplayMode | | Control display (Auto, Classic, Simplified, Overflow) |
| string | | Custom CSS class for item styling |
| string | | Keyboard shortcut keytip for item |
| TooltipSettingsModel | | Tooltip configuration (id, title, content, iconCss, cssClass) |
| string | | Custom template for item rendering |
| RibbonButtonSettingsModel | | Button-specific settings (iconCss, content, clicked) |
| RibbonDropDownSettingsModel | | DropDown-specific settings (iconCss, content, items) |
| RibbonSplitButtonSettingsModel | | SplitButton-specific settings (iconCss, items, clicked) |
| RibbonCheckBoxSettingsModel | | CheckBox-specific settings (label, checked, change) |
| RibbonColorPickerSettingsModel | | ColorPicker-specific settings (value, change) |
| RibbonComboBoxSettingsModel | | ComboBox-specific settings (dataSource, value, fields) |
| RibbonGroupButtonSettingsModel | | GroupButton-specific settings (items, selected) |
| RibbonGallerySettingsModel | | Gallery configuration (groups, items, itemCount, popupWidth, popupHeight, template) |
| 属性 | 类型 | 默认值 | 适用场景 |
|---|---|---|---|
| RibbonItemType | | 项类型:Button、CheckBox、DropDown、SplitButton、ComboBox、ColorPicker、GroupButton、Gallery |
| string | | 项的唯一标识符 |
| RibbonItemSize[] | | 项可调整的尺寸范围(响应式行为) |
| RibbonItemSize | | 项的当前显示尺寸 |
| boolean | | 禁用项以阻止用户交互 |
| DisplayMode | | 控制显示模式(自动、经典、简化、溢出) |
| string | | 项样式的自定义CSS类 |
| string | | 项的键盘快捷键 |
| TooltipSettingsModel | | 提示框配置(id、标题、内容、iconCss、cssClass) |
| string | | 项渲染的自定义模板 |
| RibbonButtonSettingsModel | | 按钮专属设置(iconCss、内容、点击事件) |
| RibbonDropDownSettingsModel | | 下拉菜单专属设置(iconCss、内容、项) |
| RibbonSplitButtonSettingsModel | | 分割按钮专属设置(iconCss、项、点击事件) |
| RibbonCheckBoxSettingsModel | | 复选框专属设置(标签、选中状态、变更事件) |
| RibbonColorPickerSettingsModel | | 颜色选择器专属设置(值、变更事件) |
| RibbonComboBoxSettingsModel | | 组合框专属设置(数据源、值、字段) |
| RibbonGroupButtonSettingsModel | | 组按钮专属设置(项、选中状态) |
| RibbonGallerySettingsModel | | Gallery配置(组、项、itemCount、popupWidth、popupHeight、模板) |
File Menu Configuration
文件菜单配置
| Property | Type | Default | When to Use |
|---|---|---|---|
| boolean | | Show/hide file menu button |
| string | | File menu button text |
| FileMenuItemModel[] | | Array of menu items (New, Open, Save, Print) |
| string | | Custom template for menu items |
| string | | Custom template for entire popup |
| string | | Keytip for file menu (F for File) |
| TooltipSettingsModel | | Tooltip settings for file menu button |
| 属性 | 类型 | 默认值 | 适用场景 |
|---|---|---|---|
| boolean | | 显示/隐藏文件菜单按钮 |
| string | | 文件菜单按钮文本 |
| FileMenuItemModel[] | | 菜单项数组(新建、打开、保存、打印) |
| string | | 菜单项的自定义模板 |
| string | | 整个弹出框的自定义模板 |
| string | | 文件菜单的快捷键(如File为F) |
| TooltipSettingsModel | | 文件菜单按钮的提示框设置 |
Backstage Configuration
后台视图配置
| Property | Type | Default | When to Use |
|---|---|---|---|
| boolean | | Show/hide backstage view |
| string | | Backstage button text |
| BackStageItemModel[] | | Backstage items (id, text, iconCss, content, separator, isFooter) |
| BackButtonModel | | Back button configuration (text, iconCss, visible) |
| string | | Backstage width dimension |
| string | | Backstage height dimension |
| HTMLElement | | Element for positioning backstage |
| string | | Custom template for backstage content |
| string | | Keytip for backstage button |
| TooltipSettingsModel | | Tooltip settings for backstage button |
| 属性 | 类型 | 默认值 | 适用场景 |
|---|---|---|---|
| boolean | | 显示/隐藏后台视图 |
| string | | 后台视图按钮文本 |
| BackStageItemModel[] | | 后台项(id、文本、iconCss、内容、分隔符、是否为页脚) |
| BackButtonModel | | 返回按钮配置(文本、iconCss、可见性) |
| string | | 后台视图宽度 |
| string | | 后台视图高度 |
| HTMLElement | | 后台视图定位的目标元素 |
| string | | 后台视图内容的自定义模板 |
| string | | 后台视图按钮的快捷键 |
| TooltipSettingsModel | | 后台视图按钮的提示框设置 |
Contextual Tab Configuration
上下文选项卡配置
| Property | Type | Default | When to Use |
|---|---|---|---|
| boolean | | Show/hide contextual tab group |
| boolean | | Whether contextual tab is active |
| RibbonTabModel[] | | Array of tabs in contextual group |
| 属性 | 类型 | 默认值 | 适用场景 |
|---|---|---|---|
| boolean | | 显示/隐藏上下文选项卡组 |
| boolean | | 上下文选项卡是否处于激活状态 |
| RibbonTabModel[] | | 上下文组中的选项卡数组 |
Key Events
核心事件
| Event | Arguments | When to Use |
|---|---|---|
| TabSelectedEventArgs | After a tab is selected (get tab index and data) |
| TabSelectingEventArgs | Before tab selection (cancelable, validate selection) |
| RibbonCollapsingEventArgs | Before ribbon collapses (cancelable) |
| RibbonExpandedEventArgs | After ribbon expands |
| LauncherClickEventArgs | When launcher icon is clicked (open dialog/pane) |
| OverflowPopupEventArgs | Before overflow popup opens (cancelable) |
| OverflowPopupEventArgs | Before overflow popup closes (cancelable) |
| LayoutSwitchedEventArgs | When layout switches between Classic/Simplified |
| BackStageItemClickEventArgs | When backstage item is clicked |
| 事件 | 参数 | 适用场景 |
|---|---|---|
| TabSelectedEventArgs | 选项卡选中后(获取选项卡索引和数据) |
| TabSelectingEventArgs | 选项卡选中前(可取消、验证选择) |
| RibbonCollapsingEventArgs | Ribbon折叠前(可取消) |
| RibbonExpandedEventArgs | Ribbon展开后 |
| LauncherClickEventArgs | 启动器图标点击时(打开对话框/面板) |
| OverflowPopupEventArgs | 溢出弹出框打开前(可取消) |
| OverflowPopupEventArgs | 溢出弹出框关闭前(可取消) |
| LayoutSwitchedEventArgs | 布局在经典/简化之间切换时 |
| BackStageItemClickEventArgs | 后台项点击时 |
File Menu Events
文件菜单事件
| Event | Arguments | When to Use |
|---|---|---|
| BeforeOpenCloseMenuEventArgs | Before file menu opens (cancelable) |
| OpenCloseMenuEventArgs | After file menu opens |
| BeforeOpenCloseMenuEventArgs | Before file menu closes (cancelable) |
| OpenCloseMenuEventArgs | After file menu closes |
| MenuEventArgs | Before menu item renders (customize rendering) |
| MenuEventArgs | When menu item is selected |
| 事件 | 参数 | 适用场景 |
|---|---|---|
| BeforeOpenCloseMenuEventArgs | 文件菜单打开前(可取消) |
| OpenCloseMenuEventArgs | 文件菜单打开后 |
| BeforeOpenCloseMenuEventArgs | 文件菜单关闭前(可取消) |
| OpenCloseMenuEventArgs | 文件菜单关闭后 |
| MenuEventArgs | 菜单项渲染前(自定义渲染) |
| MenuEventArgs | 菜单项选中时 |