Update cookies preferences
Promotic

CreateItem - method of the PmfTreeItem object

Description:
Creates new tree item (object of the PmfTreeItem type).
Syntax:
Object CreateItem(String sId, [String sTitle], [String sProps], [String sPars])
Parameters:
sId(String) The identifier of the tree item (see Id property).
 
The identifier of the item must be unique within all the items in the same parent item, must not be empty string and must not contain the characters "/" and "\".
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 specifying 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).
 
If the Title property is not set or is null, then the identifier of the item is displayed as a title of the item in the tree.
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 the item in front previously created item with id identifier.
pos:after=id - Creates the 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.
Note:
This method is also functional in Web panels.
Example:
JavaScriptSelect and copy to clipboard

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 the item with caption, colored text and inserts it in front of the "item1"
var oTreeItem3 = oTreeItem2.CreateItem("item3");   // Creates the item in the parent item "item2"

History:
Pm9.00.26: Created
PROMOTIC 9.0.28 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.