Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

RibbonButtonItem Class

A ribbon button item.

#Declaration

TypeScript
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

TypeScript
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

TypeScript
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

TypeScript
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

TypeScript
selected: boolean

#Property Value

Type Description
boolean

true to select the button; otherwise, false.

#showText Property

Specifies the item’s text visibility.

#Declaration

TypeScript
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

TypeScript
text: string

#Property Value

Type Description
string

The item text.

#toggleMode Property

Specifies whether the button is in toggle mode.

#Declaration

TypeScript
toggleMode: boolean

#Property Value

Type Description
boolean

true to enable toggle mode; otherwise, false.

#type Property

Returns the item’s type.

#Declaration

TypeScript
readonly type = RibbonItemType.Button

#Property Value

Type Description
Button

Identifies the Button item type.