| sId | (String) The identifier of the tree item (see Id property).
If the Title property is not set or is null, then the identifier in the tree is displayed as a title of the item. The identifier of the root tree item cannot be set. Its value is always "root". The item identifiers can be used to create a path, that specifies the position of the item in the tree, see GetItem and GetPath methods. |
|---|---|
| sTitle | [optional] (String) Displayed title of the tree item (see Title property).
|
| sProps | [optional] (String) Initial values of properties of the created item.
Entries are in the KeyVal format, for example: "TextColor:#0000ff;PrivateData:200;". |
| sPars | [optional] (String) Parameters of the created item. Determine the position where the item will be created.
Entries are in the KeyVal format, for example: "pos:first;". pos:before=id - Creates item in front previously created item with id identifier.
pos:after=id - Creates item behind previously created item with id identifier.
pos:first - Creates item at the first position.
pos:last (default) - Creates item at the last position. |
var oRoot = oTree.TreeRoot;
var oTreeItem1 = oRoot.CreateItem("item1");
// Creates new item in the tree root item
var oTreeItem2 = oRoot.CreateItem("item2", "Title", "TextColor:#ff0000;", "pos:before=item1;");
// Creates item with caption, colored text and inserts it in front of the "item1"
var oTreeItem3 = oTreeItem2.CreateItem("item3");
// Creates item in the parent item "item2"