TreeColumn.reduceCaptionWidthBy

Syntax

reduceCaptionWidthBy(value: Number);

Parameters

value. The value by which it is necessary to reduce the caption.

Description

The reduceCaptionWidthBy method shortens tree column heading without any influence on column contents width.

Example

To execute the example, the page must contain the TreeList  component named «treeList» (see Example of Creating the TreeList Component). Set the width of the first column visible part:

// Set the width of the first column visible part
treeList.getColumns().getItem(0).setVisibleWidth(200);

Decrease the width of the first column header by 50 pixels and check whether the header width is decreased:

// Decrease the width of the column header 
treeList.getColumns().getItem(0).reduceCaptionWidthBy(70);
// Check whether the header width is decreased
if (treeList.getColumns().getItem(0).isCaptionReduced()) {
    console.log("Header width is decreased");
    console.log("Header width: " + treeList.getColumns().getItem(0).getCaptionWidth());
} else {
    console.log("Header width is not decreased");
}
// Update column contents
treeList.getColumns().getItem(0).updateContent();

As a result, header width is smaller than contents width:

Information about first column header width decreasing is displayed to the console:

Header width is decreased

Header width: 130

See also:

TreeColumn