onExpand - event of the PmfTree object
Description:
The event is triggered when expanding or collapsing the tree item.
Parameters:
ev | (Object) Reference to an object that describes information about the event
Parameters:
ev.SrcObject | (Object) Pmf object where the event originated. |
ev.Item | (Object) Tree item (PmfTreeItem object), that has been expanded or collapsed. |
ev.Type | (Long) Specifies whether the tree item was expanded or collapsed.
0 - Tree item was collapsed.
1 - Tree item was expanded. |
---|
|
---|
Note:
This event is is functional only in
JavaScript language.
The event is triggered when expanding or collapsing the tree item occurs, for example by the mouse, the keyboard or as a result of calling the methods
SetSel,
SetExpanded,
SetVisible, etc.
This event is not triggered if in the expanded item all subitems are removed or if the item itself is removed.
Example:
JavaScriptSelect and copy to clipboard
var oForm = pMe.Form;
var oTree = oForm.CreateItem("tree", "id_tree1");
var oRoot = oTree.TreeRoot;
oRoot.CreateItem("item1");
oRoot.CreateItem("item2");
// ... Additional tree settings
// The function is registered into the onExpand event.
function onTreeExpand(ev)
{
Pm.Debug("PmfTree.onExpand, tree item id = " + ev.Item.Id ", expand type = " + ev.Type);
}
oTree.AddEvent("onExpand", "Id_Expand", onTreeExpand);