ListCaptions.insert

Syntax

insert(caption, index);

Parameters

caption. PP.Ui.Caption | Object. Title.

index. Number. Index. If it is not specified, the title is inserted to the end.

Description

The insert method adds a new title by the specified index.

Example

Executing the example requires the SimpleTreeList component with the Tree identifier (see Example of Creating the SimpleTreeList Component).

// Get tree titles
caps = Tree.getCaptions();
// Reduce width of current titles
caps.getCaptions()[0].setWidth(100);
caps.getCaptions()[1].setWidth(100);
// Add a new title
caps.insert({Content: "Third", MinWidth: "40", Width: "100"})

After executing the example a new title is added.

See also:

ListCaptions