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

RibbonColorBoxItem Class

A ribbon color box item.

#Declaration

TypeScript
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

TypeScript
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

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

#text Property

Specifies the text displayed by the item input element.

#Declaration

TypeScript
text: string

#Property Value

Type Description
string

The item text.

#textOptions Property

Specifies options of the text displayed next to the item.

#Declaration

TypeScript

#Property Value

Type Description
RibbonItemTextOptions

An object that contains text options.

#type Property

Returns the item’s type.

#Declaration

TypeScript
readonly type = RibbonItemType.ColorBox

#Property Value

Type Description
ColorBox

Identifies the ColorBox item type.

#value Property

Specifies the currently selected color in text format.

#Declaration

TypeScript
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)";