AnyChart
API Reference
Still have questions?
Contact support
Top

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

Getter for the labels background settings.

Returns:

anychart.core.ui.Background - Labels background.
Setter for the labels background settings.

Params:

NameTypeDefaultDescription
settingsstring | Object | null | boolean
true
Background settings to set.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.

content

Getter for buttons content.

Returns:

string | number - Buttons content.
See listing
var content = buttons.content();
Setter for buttons content.

Params:

NameTypeDescription
contentstring | numberButtons content.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.
Setter for buttons content using function.

Params:

NameTypeDescription
functionfunction(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.

cursor

Getter for the cursor type.

Returns:

anychart.enums.Cursor | string - Cursor type.
See listing
var buttons = dataGrid.buttons();
var cursor = buttons.cursor();
Setter for the cursor type.

Params:

NameTypeDefaultDescription
cursorTypestring | anychart.enums.Cursor
'pointer'
Cursor type to set.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.

disablePointerEvents

Getter for the state of disablePointerEvents option.

Returns:

boolean - If pointer events are disabled.
See listing
var disablePointerEvents = buttons.disablePointerEvents();
Setter for the text disablePointerEvents option.

Params:

NameTypeDefaultDescription
enabledboolean
false
Value to set.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.

enabled

Getter for the element state (enabled or disabled).

Returns:

boolean - Element state.
Setter for the element enabled state.

Params:

NameTypeDefaultDescription
enabledboolean
true
Enabled state to set.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.
Example.
if (!element.enabled())
   element.enabled(true);

fontColor

Getter for button font color.

Returns:

string - Font color settings.
See listing
var fontColor = buttons.fontColor();
Setter for button font color settings.

Params:

NameTypeDescription
colorstringValue to set.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.

fontDecoration

Getter for the button text font decoration.

Returns:

anychart.graphics.vector.Text.Decoration | string - Font decoration.
See listing
var fontDecoration = buttons.fontDecoration();
Setter for the button text font decoration.

Params:

NameTypeDefaultDescription
fontDecorationanychart.graphics.vector.Text.Decoration | string
anychart.graphics.vector.Text.Decoration#NONE
Value to set.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.

fontFamily

Getter for the button font family of text.

Returns:

string - Font family.
See listing
var fontFamily = buttons.fontFamily();
Setter for the button font family of text.

Params:

NameTypeDefaultDescription
fontFamilystring
'Verdana, Helvetica, Arial, sans-serif'
Font family.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.

fontOpacity

Getter for the button text font opacity.

Returns:

number - Font opacity.
See listing
var fontOpacity = buttons.fontOpacity();
Setter for the button text font opacity.
Double value from 0 to 1.

Params:

NameTypeDescription
opacitynumberValue to set.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.

fontSize

Getter for button font size.

Returns:

number - Font size settings.
See listing
var fontSize = buttons.fontSize();
Setter for button font size settings.

Params:

NameTypeDescription
sizenumber | stringFont size to set.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.

fontStyle

Getter for the button text font style.

Returns:

anychart.graphics.vector.Text.FontStyle | string - Font style.
See listing
var fontStyle = buttons.fontStyle();
Setter for the button text font style.

Params:

NameTypeDescription
styleanychart.graphics.vector.Text.FontStyle | stringValue to set.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.

fontVariant

Getter for the button text font variant.

Returns:

anychart.graphics.vector.Text.FontVariant | string - Font variant.
See listing
var fontVariant = buttons.fontVariant();
Setter for the button text font variant.

Params:

NameTypeDescription
typeanychart.graphics.vector.Text.FontVariant | stringValue to set.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.

fontWeight

Getter for the button text font weight.

Returns:

string | number - Font weight.
See listing
var fontWeight = buttons.fontWeight();
Setter for the button text font weight. https://www.w3schools.com/cssref/pr_font_weight.asp

Params:

NameTypeDescription
weightstring | numberValue to set.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.

hAlign

Getter for the button text horizontal align.

Returns:

anychart.graphics.vector.Text.HAlign | string - Text horizontal align.
See listing
var hAlign = buttons.hAlign();
Setter for the button text horizontal align.

Params:

NameTypeDefaultDescription
alignanychart.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

Getter for the buttons height.

Returns:

number | string - Buttons height.
See listing
var buttons = dataGrid.buttons();
var height = buttons.height();
Setter for the buttons height.

Params:

NameTypeDescription
heightnumber | stringButtons height to set.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.

hovered

Getter for hovered state settings.
The hovered state is a hover on the button in the normal state.

Returns:

anychart.core.StateSettings - Hovered state settings
Setter for hovered state settings.
The hovered state is a hover on the button in the normal state.

Params:

NameTypeDescription
settingsObjectState settings to set.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.

letterSpacing

Getter for the button text letter spacing.

Returns:

string | number - Letter spacing.
See listing
var letterSpacing = buttons.letterSpacing();
Setter for the button text letter spacing. https://www.w3schools.com/cssref/pr_text_letter-spacing.asp

Params:

NameTypeDescription
spacingstring | numberValue to set.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.

lineHeight

Getter for the button text line height.

Returns:

string | number - Text line height.
See listing
var lineHeight = buttons.lineHeight();
Setter for the button text line height. https://www.w3schools.com/cssref/pr_text_letter-spacing.asp

Params:

NameTypeDescription
heightstring | numberValue to set.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.

normal

Getter for normal state settings.
The normal state is the button in the collapsed state.

Returns:

anychart.core.StateSettings - Normal state settings.
Setter for normal state settings.
The normal state is the button in the collapsed state.

Params:

NameTypeDescription
settingsObjectState settings to set.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.

padding

Setter for the buttons padding in pixels by one value.

Params:

NameTypeDescription
paddingArray.<(number|string)> | ObjectAn array of field values to set.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.
Setter for the buttons padding in pixels using several numbers.

Params:

NameTypeDefaultDescription
value1string | number
5
Top or top-bottom space.
value2string | number
10
Right or right-left space.
value3string | number
5
Bottom space.
value4string | number
10
Left space.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.
Example
// 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);

selectable

Getter for the text selectable option.

Returns:

boolean - Text selectable option.
See listing
var textOverflow = buttons.selectable();
Setter for the text selectable.

Params:

NameTypeDefaultDescription
enabledboolean
false
Value to set.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.

selected

Getter for selected state settings.
The selected state is the button in the expanded state.

Returns:

anychart.core.StateSettings - Selected state settings
Setter for selected state settings.
The selected state is the button in the expanded state.

Params:

NameTypeDescription
settingsObjectState settings to set.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.

textDirection

Getter for the button text direction.

Returns:

anychart.graphics.vector.Text.Direction | string - Text direction.
See listing
var textDirection = buttons.textDirection();
Setter for the button text direction.

Params:

NameTypeDefaultDescription
typeanychart.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

Getter for the button text indent.

Returns:

number - Text indent.
See listing
var textIndent = buttons.textIndent();
Setter for the button text indent.

Params:

NameTypeDescription
indentnumberValue to set.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.

textOverflow

Getter for the text overflow.

Returns:

anychart.graphics.vector.Text.TextOverflow | string - Text overflow settings.
See listing
var textOverflow = buttons.textOverflow();
Setter for the text overflow settings.

Params:

NameTypeDefaultDescription
valueanychart.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

Getter for button text shadow.

Returns:

string - String representation of text shadow.
See listing
var fontColor = buttons.textShadow();
Setter for button text shadow settings.

Params:

NameTypeDefaultDescription
textShadowanychart.graphics.vector.TextShadow | string
'none'
Text shadow to set.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.

useHtml

Getter for the useHtml flag.

Returns:

boolean - Boolean flag.
See listing
var useHtml = buttons.useHtml();
Setter for button text as useHtml.

Params:

NameTypeDescription
enabledbooleanValue to set.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.

vAlign

Getter for the button text vertical align.

Returns:

anychart.graphics.vector.Text.VAlign | string - Text vertical align.
See listing
var vAlign = buttons.vAlign();
Setter for the button text vertical align.

Params:

NameTypeDefaultDescription
alignanychart.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

Getter for the buttons width.

Returns:

number | string - Buttons width.
See listing
var buttons = dataGrid.buttons();
var width = buttons.width();
Setter for the buttons width.

Params:

NameTypeDescription
widthnumber | stringButtons width to set.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.

wordBreak

Getter for the word-break mode.

Returns:

anychart.enums.WordBreak | string - Word-break mode.
See listing
var wordBreak = buttons.wordBreak();
Setter for the word-break mode.

Params:

NameTypeDescription
typeanychart.enums.WordBreak | stringValue to set.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.

wordWrap

Getter for the word-wrap mode.

Returns:

anychart.enums.WordWrap | string - Word-wrap mode.
See listing
var wordWrap = buttons.wordWrap();
Setter for the word-wrap mode.

Params:

NameTypeDescription
typeanychart.enums.WordWrap | stringValue to set.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.

zIndex

Getter for the Z-index of the element.

Returns:

number - Z-index.
Setter for the Z-index of the element.

Params:

NameTypeDefaultDescription
zIndexnumber
0
Value to set.

Returns:

anychart.core.gantt.DataGridButton - Self instance for method chaining.