Skip to main content
A newer version of this page is available. .

RibbonButtonItem Class

A ribbon button item.

Declaration

export class RibbonButtonItem extends RibbonItemBase

Remarks

var ribbonButton = new DevExpress.RichEdit.RibbonButtonItem("sendEmail", "Send Email",
  {icon: "email", showText: true, beginGroup: true});

var options = DevExpress.RichEdit.createOptions();
options.ribbon.getTab(DevExpress.RichEdit.RibbonTabType.Home).insertItem(ribbonButton,2);
options.events.customCommandExecuted.addHandler(function(s, e) {
  switch (e.commandName) {
    case 'sendEmail':
      var text = s.document.getText();
      var mailto_link = 'mailto:bob@example.com?subject=Test&body=' + encodeURIComponent(text);
      window = window.open(mailto_link, 'emailWindow');
      if(window && window.open && !window.closed)
        window.close();
      break;
  }
});

Inherited Members

Inheritance

RibbonItemBase
RibbonButtonItem
See Also

constructor(id, text)

Initializes a new instance of the RibbonButtonItem class with specified settings.

Declaration

constructor(
    id: RibbonItemId,
    text: string,
    options?: RibbonButtonItemOptions
)

Parameters

Name Type Description
id RibbonItemId

The item identifier.

text string

The item text.

options RibbonButtonItemOptions

The item options.

Properties

icon Property

Specifies the item icon’s identifier.

Declaration

icon?: string

Property Value

Type Description
string

An icon identifier.

Remarks

Refer to the following help topic to view the full list of available icons and their identifiers: Built-In Icon Library.

localizationId Property

Specifies an identifier that allows you to localize the item’s text.

Declaration

localizationId?: string

Property Value

Type Description
string

The item’s localization identifier.

Remarks

If the text property is specified, the item is not localized.

See Also

selected Property

Specifies whether the button is selected.

Declaration

selected: boolean

Property Value

Type Description
boolean

true to select the button; otherwise, false.

showText Property

Specifies the item’s text visibility.

Declaration

showText: boolean

Property Value

Type Description
boolean

true to display the item’s text; otherwise, false.

Remarks

Use the text property to specify the item text.

text Property

Specifies the item text.

Declaration

text: string

Property Value

Type Description
string

The item text.

toggleMode Property

Specifies whether the button is in toggle mode.

Declaration

toggleMode: boolean

Property Value

Type Description
boolean

true to enable toggle mode; otherwise, false.

type Property

Returns the item’s type.

Declaration

readonly type: RibbonItemType

Property Value

Type Description
RibbonItemType

Identifies the Button item type.