aspnetcore-js-devexpress-dot-richedit-edb874be.md
Contains ribbon settings.
export class Ribbon
See Also
Specifies the active tab by its index.
activeTabIndex: number
| Type | Description |
|---|---|
| number |
A zero-based tab index.
|
var options = DevExpress.RichEdit.createOptions();
options.ribbon.activeTabIndex=3;
Sets ribbon visibility.
visible: boolean
| Type | Description |
|---|---|
| boolean |
true - to display the ribbon; false - to hide the ribbon.
|
richEdit.updateRibbon(function (ribbon) {
ribbon.visible=false;
});
Removes all ribbon tabs.
clearTabs(): void
var options = DevExpress.RichEdit.createOptions();
var homeTab = options.ribbon.getTab(DevExpress.RichEdit.RibbonTabType.Home)
options.ribbon.clearTabs();
options.ribbon.insertTab(homeTab);
});
Returns a ribbon tab with the specified ID.
getTab(
id: RibbonTabId
): RibbonTab | null
| Name | Type | Description |
|---|---|---|
| id | RibbonTabId |
The ribbon tab identifier.
|
| Type | Description |
|---|---|
| RibbonTab |
The tab with the specified ID. null if a tab with the specified ID is not found.
|
//move the Home tab to the third position
var options = DevExpress.RichEdit.createOptions();
var homeTab = options.ribbon.getTab(DevExpress.RichEdit.RibbonTabType.Home)
options.ribbon.insertTab(options.ribbon.removeTab(homeTab), 2)
});
Inserts a tab at the specified position.
insertTab(
tab: RibbonTab,
index?: number
): RibbonTab
| Name | Type | Description |
|---|---|---|
| tab | RibbonTab |
A ribbon tab to insert.
| | index | number |
The zero-based index at which the specified tab should be inserted.
|
| Type | Description |
|---|---|
| RibbonTab |
The inserted tab.
|
//move the Home tab to the third position
var options = DevExpress.RichEdit.createOptions();
options.ribbon.insertTab(options.ribbon.removeTab(DevExpress.RichEdit.RibbonTabType.Home),2);
Inserts a tab after the target tab.
insertTabAfter(
tab: RibbonTab,
target: RibbonTab | RibbonTabId
): RibbonTab
| Name | Type | Description |
|---|---|---|
| tab | RibbonTab |
A ribbon tab to insert.
| | target | RibbonTab | RibbonTabId |
The target tab or its identifier.
|
| Type | Description |
|---|---|
| RibbonTab |
The tab that was inserted.
|
var options = DevExpress.RichEdit.createOptions();
var mailMergeTab = options.ribbon.removeTab(DevExpress.RichEdit.RibbonTabType.MailMerge);
options.ribbon.insertTabAfter(mailMergeTab, DevExpress.RichEdit.RibbonTabType.Home);
If the ribbon does not contain the target tab, the control inserts a tab at the last position.
Inserts a tab before the target tab.
insertTabBefore(
tab: RibbonTab,
target: RibbonTab | RibbonTabId
): RibbonTab
| Name | Type | Description |
|---|---|---|
| tab | RibbonTab |
A ribbon tab to insert.
| | target | RibbonTab | RibbonTabId |
The target tab or its identifier.
|
| Type | Description |
|---|---|
| RibbonTab |
The tab that was inserted.
|
var options = DevExpress.RichEdit.createOptions();
var mailMergeTab = options.ribbon.removeTab(DevExpress.RichEdit.RibbonTabType.MailMerge);
options.ribbon.insertTabBefore(mailMergeTab, DevExpress.RichEdit.RibbonTabType.Home);
If the ribbon does not contain the target tab, the control inserts a tab at the last position.
Removes the tab with the specified ID from the ribbon.
removeTab(
id: RibbonTabId
): RibbonTab | null
| Name | Type | Description |
|---|---|---|
| id | RibbonTabId |
The ribbon tab identifier.
|
| Type | Description |
|---|---|
| RibbonTab |
The tab that was removed. null if a tab with the specified ID is not found.
|
The code sample below moves the Home tab to the first position in the ribbon.
//move the Home tab to the third position
var options = DevExpress.RichEdit.createOptions();
options.ribbon.insertTab(options.ribbon.removeTab(DevExpress.RichEdit.RibbonTabType.Home),2);
Removes the specified tab from the ribbon.
removeTab(
tab: RibbonTab
): RibbonTab | null
| Name | Type | Description |
|---|---|---|
| tab | RibbonTab |
The tab to remove.
|
| Type | Description |
|---|---|
| RibbonTab |
The tab that was removed. null if a tab with the specified ID is not found.
|
The code sample below moves the Home tab to the first position in the ribbon.
//move the Home tab to the third position
var options = DevExpress.RichEdit.createOptions();
var homeTab = options.ribbon.getTab(DevExpress.RichEdit.RibbonTabType.Home)
options.ribbon.insertTab(options.ribbon.removeTab(homeTab), 2)
});