class anychart.core.gantt.DataGridButton Improve this Doc
Extends: anychart.core.VisualBase
Collapse-expand button.
Methods Overview
| Specific settings | |
| content() | Buttons content. |
| cursor() | Cursor type |
| Advanced Text Settings | |
| letterSpacing() | Button text letter spacing. |
| lineHeight() | Button text line height. |
| textIndent() | Button text indent. |
| textOverflow() | Button text overflow. |
| useHtml() | Disable/Enable text useHtml. |
| wordBreak() | Word break mode. |
| wordWrap() | Word-wrap mode. |
| Coloring | |
| background() | Background settings. |
| Events | |
| disablePointerEvents() | Disable/Enable pointer events. |
| Interactivity | |
| enabled() | Element state (enabled or disabled). |
| hovered() | Hovered state settings. |
| normal() | Normal state settings. |
| selectable() | Text selectable option. |
| selected() | Selected state settings. |
| Size and Position | |
| height() | Buttons height. |
| padding() | Padding settings. |
| width() | Buttons width. |
| zIndex() | Z-index of the element. |
| Text Settings | |
| fontColor() | Button font color. |
| fontDecoration() | Button font decoration. |
| fontFamily() | Button font family. |
| fontOpacity() | Button font opacity. |
| fontSize() | Button font size. |
| fontStyle() | Button font style. |
| fontVariant() | Button font variant. |
| fontWeight() | Button text font weight. |
| hAlign() | Button text horizontal align. |
| textDirection() | Button text direction. |
| textShadow() | Button text shadow. |
| vAlign() | Button text vertical align. |
Methods Description
background
Returns:
anychart.core.ui.Background - Labels background.Try it:
- null/boolean - disable or enable labels background.
- string - sets labels background color value.
- object - sets labels background settings.
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| settings | string | Object | null | boolean | true | Background settings to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.content
Returns:
string | number - Buttons content.var content = buttons.content();
Params:
| Name | Type | Description |
|---|---|---|
| content | string | number | Buttons content. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.Try it:
Params:
| Name | Type | Description |
|---|---|---|
| function | function(path:anychart.graphics.vector.Path) | Buttons content.
Function that looks like: function(anychart.graphics.vector.Path){
// this.path - button element, instance of anychart.graphics.vector.Path
// this.width - button width (number).
// this.height - button height (number).
// this.state - button state: normal, hovered or selected (string).
} |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.Try it:
cursor
Returns:
anychart.enums.Cursor | string - Cursor type.var buttons = dataGrid.buttons(); var cursor = buttons.cursor();
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| cursorType | string | anychart.enums.Cursor | 'pointer' | Cursor type to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.Try it:
disablePointerEvents
Returns:
boolean - If pointer events are disabled.var disablePointerEvents = buttons.disablePointerEvents();
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| enabled | boolean | false | Value to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.enabled
Returns:
boolean - Element state.Try it:
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| enabled | boolean | true | Enabled state to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.if (!element.enabled()) element.enabled(true);
Try it:
fontColor
Returns:
string - Font color settings.var fontColor = buttons.fontColor();
Params:
| Name | Type | Description |
|---|---|---|
| color | string | Value to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.Try it:
fontDecoration
Returns:
anychart.graphics.vector.Text.Decoration | string - Font decoration.var fontDecoration = buttons.fontDecoration();
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| fontDecoration | anychart.graphics.vector.Text.Decoration | string | anychart.graphics.vector.Text.Decoration#NONE | Value to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.Try it:
fontFamily
Returns:
string - Font family.var fontFamily = buttons.fontFamily();
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| fontFamily | string | 'Verdana, Helvetica, Arial, sans-serif' | Font family. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.Try it:
fontOpacity
Returns:
number - Font opacity.var fontOpacity = buttons.fontOpacity();
Double value from 0 to 1.
Params:
| Name | Type | Description |
|---|---|---|
| opacity | number | Value to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.Try it:
fontSize
Returns:
number - Font size settings.var fontSize = buttons.fontSize();
Params:
| Name | Type | Description |
|---|---|---|
| size | number | string | Font size to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.Try it:
fontStyle
Returns:
anychart.graphics.vector.Text.FontStyle | string - Font style.var fontStyle = buttons.fontStyle();
Params:
| Name | Type | Description |
|---|---|---|
| style | anychart.graphics.vector.Text.FontStyle | string | Value to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.Try it:
fontVariant
Returns:
anychart.graphics.vector.Text.FontVariant | string - Font variant.var fontVariant = buttons.fontVariant();
Params:
| Name | Type | Description |
|---|---|---|
| type | anychart.graphics.vector.Text.FontVariant | string | Value to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.Try it:
fontWeight
Returns:
string | number - Font weight.var fontWeight = buttons.fontWeight();
Params:
| Name | Type | Description |
|---|---|---|
| weight | string | number | Value to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.Try it:
hAlign
Returns:
anychart.graphics.vector.Text.HAlign | string - Text horizontal align.var hAlign = buttons.hAlign();
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| align | anychart.graphics.vector.Text.HAlign | string | anychart.graphics.vector.Text.HAlign#START | Value to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.height
Returns:
number | string - Buttons height.var buttons = dataGrid.buttons(); var height = buttons.height();
Params:
| Name | Type | Description |
|---|---|---|
| height | number | string | Buttons height to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.Try it:
hovered
The hovered state is a hover on the button in the normal state.
Returns:
anychart.core.StateSettings - Hovered state settingsTry it:
The hovered state is a hover on the button in the normal state.
Params:
| Name | Type | Description |
|---|---|---|
| settings | Object | State settings to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.Try it:
letterSpacing
Returns:
string | number - Letter spacing.var letterSpacing = buttons.letterSpacing();
Params:
| Name | Type | Description |
|---|---|---|
| spacing | string | number | Value to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.Try it:
lineHeight
Returns:
string | number - Text line height.var lineHeight = buttons.lineHeight();
Params:
| Name | Type | Description |
|---|---|---|
| height | string | number | Value to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.normal
The normal state is the button in the collapsed state.
Returns:
anychart.core.StateSettings - Normal state settings.Try it:
The normal state is the button in the collapsed state.
Params:
| Name | Type | Description |
|---|---|---|
| settings | Object | State settings to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.Try it:
padding
Returns:
anychart.core.utils.Padding - The buttons padding.Try it:
Params:
| Name | Type | Description |
|---|---|---|
| padding | Array.<(number|string)> | Object | An array of field values to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.Try it:
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| value1 | string | number | 5 | Top or top-bottom space. |
| value2 | string | number | 10 | Right or right-left space. |
| value3 | string | number | 5 | Bottom space. |
| value4 | string | number | 10 | Left space. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.// 1) top and bottom 10px, left and right 15px buttons.padding(10, '15px'); // 2) top 10px, left and right 15px, bottom 5px buttons.padding(10, '15px', 5); // 3) top 10px, right 15px, bottom 5px, left 12px buttons.padding(10, '15px', '5px', 12);
Try it:
selectable
Returns:
boolean - Text selectable option.var textOverflow = buttons.selectable();
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| enabled | boolean | false | Value to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.selected
The selected state is the button in the expanded state.
Returns:
anychart.core.StateSettings - Selected state settingsTry it:
The selected state is the button in the expanded state.
Params:
| Name | Type | Description |
|---|---|---|
| settings | Object | State settings to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.Try it:
textDirection
Returns:
anychart.graphics.vector.Text.Direction | string - Text direction.var textDirection = buttons.textDirection();
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| type | anychart.graphics.vector.Text.Direction | string | anychart.graphics.vector.Text.Direction#LTR | Value to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.textIndent
Returns:
number - Text indent.var textIndent = buttons.textIndent();
Params:
| Name | Type | Description |
|---|---|---|
| indent | number | Value to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.textOverflow
Returns:
anychart.graphics.vector.Text.TextOverflow | string - Text overflow settings.var textOverflow = buttons.textOverflow();
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| value | anychart.graphics.vector.Text.TextOverflow | string | anychart.graphics.vector.Text.TextOverflow#CLIP | Value to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.textShadow
Returns:
string - String representation of text shadow.var fontColor = buttons.textShadow();
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| textShadow | anychart.graphics.vector.TextShadow | string | 'none' | Text shadow to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.Try it:
useHtml
Returns:
boolean - Boolean flag.var useHtml = buttons.useHtml();
Params:
| Name | Type | Description |
|---|---|---|
| enabled | boolean | Value to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.vAlign
Returns:
anychart.graphics.vector.Text.VAlign | string - Text vertical align.var vAlign = buttons.vAlign();
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| align | anychart.graphics.vector.Text.VAlign | string | anychart.graphics.vector.Text.VAlign#TOP | Value to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.width
Returns:
number | string - Buttons width.var buttons = dataGrid.buttons(); var width = buttons.width();
Params:
| Name | Type | Description |
|---|---|---|
| width | number | string | Buttons width to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.Try it:
wordBreak
Returns:
anychart.enums.WordBreak | string - Word-break mode.var wordBreak = buttons.wordBreak();
Params:
| Name | Type | Description |
|---|---|---|
| type | anychart.enums.WordBreak | string | Value to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.wordWrap
Returns:
anychart.enums.WordWrap | string - Word-wrap mode.var wordWrap = buttons.wordWrap();
Params:
| Name | Type | Description |
|---|---|---|
| type | anychart.enums.WordWrap | string | Value to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.zIndex
Params:
| Name | Type | Default | Description |
|---|---|---|---|
| zIndex | number | 0 | Value to set. |
Returns:
anychart.core.gantt.DataGridButton - Self instance for method chaining.Try it:
