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.
Events
disablePointerEvents()Disable/Enable pointer events.
Interactivity
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.
vAlign()Button text vertical align.

Methods Description

content

Getter for buttons content.

Returns:

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

Params:

Name Type Description
content string | number Buttons content.

Returns:

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

Try it:

Setter for buttons content using function.

Params:

Name Type Description
function function 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

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:

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

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:

Name Type Default Description
value boolean
false
Value to set.

Returns:

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

fontColor

Getter for button font color.

Returns:

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

Params:

Name Type Description
value string Value to set.

Returns:

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

Try it:

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:

Name Type Default Description
value 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

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:

Name Type Default Description
value string
"Verdana, Helvetica, Arial, sans-serif"
Font family.

Returns:

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

Try it:

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:

Name Type Description
value number Value to set.

Returns:

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

Try it:

fontSize

Getter for button font size.

Returns:

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

Params:

Name Type Description
value number | string Value to set.

Returns:

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

Try it:

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:

Name Type Description
value anychart.graphics.vector.Text.FontStyle | string Value to set.

Returns:

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

Try it:

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:

Name Type Description
value anychart.graphics.vector.Text.FontVariant | string Value to set.

Returns:

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

Try it:

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:

Name Type Description
value string | number Value to set.

Returns:

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

Try it:

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:

Name Type Default Description
value 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

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:

Name Type Description
height number | string Buttons height to set.

Returns:

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

Try it:

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

Try it:

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

Params:

Name Type Description
value Object State settings to set.

Returns:

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

Try it:

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:

Name Type Description
value string | number Value to set.

Returns:

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

Try it:

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:

Name Type Description
value string | number Value 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.

Try it:

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

Params:

Name Type Description
value Object State settings to set.

Returns:

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

Try it:

padding

Setter for the buttons padding in pixels by one value.

Params:

Name Type Description
value Array.<(number|string)> | Object An array of field values to set.

Returns:

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

Try it:

Setter for the buttons padding in pixels using several numbers.

Params:

Name Type Default Description
top string | number
5
Top or top-bottom space.
right string | number
10
Right or right-left space.
bottom string | number
5
Bottom space.
left string | 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);

Try it:

selectable

Getter for the text selectable option.

Returns:

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

Params:

Name Type Default Description
value boolean
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

Try it:

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

Params:

Name Type Description
value Object State settings to set.

Returns:

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

Try it:

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:

Name Type Default Description
value 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

Getter for the button text indent.

Returns:

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

Params:

Name Type Description
value number Value 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:

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.

useHtml

Getter for the useHtml flag.

Returns:

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

Params:

Name Type Description
value boolean Value 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:

Name Type Default Description
value 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

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:

Name Type Description
width number | string Buttons width to set.

Returns:

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

Try it:

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:

Name Type Description
value anychart.enums.WordBreak | string Value 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:

Name Type Description
value anychart.enums.WordWrap | string Value 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.

Try it:

Setter for the Z-index of the element.

Params:

Name Type Default Description
value number
0
Value to set.

Returns:

anychart.core.VisualBase - Self instance for method chaining.

Try it: