Back to Devexpress

RibbonButtonItem Class

aspnetcore-js-devexpress-dot-richedit-9c54da17.md

latest4.3 KB
Original Source

RibbonButtonItem Class

A ribbon button item.

Declaration

ts
export class RibbonButtonItem extends RibbonItemBase

Remarks

javascript
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:[email protected]?subject=Test&body=' + encodeURIComponent(text);
      window = window.open(mailto_link, 'emailWindow');
      if(window && window.open && !window.closed)
        window.close();
      break;
  }
});

Inherited Members

beginGroup

id

Inheritance

RibbonItemBase RibbonButtonItem

See Also

Ribbon Customization

constructor(id, text)

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

Declaration

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

Parameters

NameTypeDescription
idRibbonItemId

The item identifier.

| | text | string |

The item text.

| | options | RibbonButtonItemOptions |

The item options.

|

Properties

icon Property

Specifies the item icon’s identifier.

Declaration

ts
icon?: string

Property Value

TypeDescription
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

ts
localizationId?: string

Property Value

TypeDescription
string

The item’s localization identifier.

|

Remarks

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

See Also

Angular Application - Custom Localization Strings

selected Property

Specifies whether the button is selected.

Declaration

ts
selected: boolean

Property Value

TypeDescription
boolean

true to select the button; otherwise, false.

|

showText Property

Specifies the item’s text visibility.

Declaration

ts
showText: boolean

Property Value

TypeDescription
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

ts
text: string

Property Value

TypeDescription
string

The item text.

|

toggleMode Property

Specifies whether the button is in toggle mode.

Declaration

ts
toggleMode: boolean

Property Value

TypeDescription
boolean

true to enable toggle mode; otherwise, false.

|

type Property

Returns the item’s type.

Declaration

ts
readonly type = RibbonItemType.Button

Property Value

TypeDescription
Button

Identifies the Button item type.

|