| nWhat | (Long) Type of the path or the position of the requested tree item (object of the PmfTreeItem type).
0 - Returns the item on the path consisting of of identifiers of individual tree items.
See the PmfTreeItem.Id property. 1 - Returns an item located on the path composing of indexes of individual tree items (zero-based index).
If vPar is a number (index), then it returns the subitem with this index. 10 - Returns the previous tree item at the same level, as the item over which the method is called.
If the method is called over the first item at that level of the tree, then it returns null. 11 - Returns the previous item in the specified tree branch. Root item (root) of the requested tree branch is specified in the vPar parameter.
If the vPar parameter has value null, then the previous item in the entire tree is searched. 20 - Returns the next tree item at the same level, as the item over which the method is called.
If the method is called above the last item on that level of the tree, then it returns null. 21 - Returns the next item in the specified tree branch. Root item (root) of the requested tree branch is specified in the vPar parameter.
If the vPar parameter has value null, then the next item in the entire tree is searched. |
|---|---|
| vPar | (Variant) String with the path to the requested tree item or the index of the requested tree item or reference to the PmfTreeItem object. The value depends on the value of the nWhat parameter. |
| nAttr | [optional] (Long) Additional attributes.
0 (default) - Returns null, if requested dynamic item (see RequestType), or some dynamic parent item is not read yet.
By calling of the GetItem method therefore is not triggered the onItemRequest event. 1 - If the requested dynamic item (see the RequestType property) is not read yet, then the onItemRequest event is triggered. |
var oTreeItem1 = oTreeItem.GetItem(0, "/id1/id2");
// Absolute path composed of item identifiers
var oTreeItem2 = oTreeItem.GetItem(0, "../../id1/id2");
// Relative path composed of item identifiers
var oTreeItem3 = oTreeItem.GetItem(1, 0);
// Returns first subitem (subitem with index 0)
var oTreeItem4 = oTreeItem.GetItem(1, "/2/5");
// Absolute path composed of item indexes
var oTreeItem5 = oTreeItem.GetItem(10, null);
// Returns the previous item at the same tree level
var oTreeItem6 = oTreeItem.GetItem(11, null);
// Returns the previous item, searches the entire tree
var oTreeItem7 = oTreeItem.GetItem(11, oItemA);
// Returns the previous item, searched in the branch starting with oItemA
var oTreeItem8 = oTreeItem.GetItem(20, null);
// Returns the following item at the same tree level
var oTreeItem9 = oTreeItem.GetItem(21, null);
// Returns the following item, the whole tree is searched
var oTreeItem10 = oTreeItem.GetItem(21, oItemA);
// Returns the following item, the branch starting with oItemA is searched