RibbonColorBoxItem Class

A ribbon color box item.

Declaration

export class RibbonColorBoxItem extends RibbonItemBase

Remarks

var ribbonColorBox = new DevExpress.RichEdit.RibbonColorBoxItem;
ribbonColorBox.id = "myColorBox";
ribbonColorBox.beginGroup = true;
ribbonColorBox.text = "My Color";
ribbonColorBox.value = "red";

var options = DevExpress.RichEdit.createOptions();
options.ribbon.getTab(DevExpress.RichEdit.RibbonTabType.Home).insertItem(ribbonColorBox,3);
options.events.customCommandExecuted.addHandler(function(s, e) {
  switch (e.commandName) {
    case 'myColorBox':
          console.log(e.parameter);
    }
});

Inherited Members

Inheritance

RibbonItemBase
RibbonColorBoxItem
See Also

constructor(id, text, value)

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

Declaration

constructor(
    id: RibbonItemId,
    text: string,
    value: string,
    options?: RibbonColorBoxItemOptions
)

Parameters

Name Type Description
id RibbonItemId

The item identifier.

text string

The item text.

value string

The current editor color.

options RibbonColorBoxItemOptions

The item options.

Properties

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

text Property

Specifies the text displayed by the item input element.

Declaration

text: string

Property Value

Type Description
string

The item text.

textOptions Property

Specifies options of the text displayed next to the item.

Declaration

textOptions: RibbonItemTextOptions

Property Value

Type Description
RibbonItemTextOptions

An object that contains text options.

type Property

Returns the item's type.

Declaration

readonly type: RibbonItemType

Property Value

Type Description
RibbonItemType

Identifies the ColorBox item type.

value Property

Specifies the currently selected color in text format.

Declaration

value: string

Property Value

Type Description
string

The current editor color.

Remarks

The value property supports the following color formats.

  • HTML color name

    ribbonColorBox.value = "yellow";
    
  • Longhand hexadecimal notation

    ribbonColorBox.value = "#FFFF00";
    
  • Shorthand hexadecimal notation

    ribbonColorBox.value = "#FF0";
    
  • RGB format

    ribbonColorBox.value = "rgb(255,255,0)";