ui.Dialog.deleteNode
Deletes a node from the specified tree-view.
Syntax
deleteNode(
name STRING,
index INTEGER )
- name is the name of the screen record, see Identifying screen-arrays in dialog methods.
- index is the index of the node in the program array that has to be deleted (starts at 1).
Usage
The deleteNode()
method
is similar to deleteRow()
,
except that it has to be used when the dialog controls a tree view.
This method
must be used when modifying the array of a tree view during the execution
of the dialog, for example when implementing a dynamic tree with ON
EXPAND
/ ON COLLAPSE
triggers. Before the
execution of the dialog, you can fill the program array directly.
This includes the context of BEFORE DISPLAY
or BEFORE
DIALOG
control blocks.
The main difference with deleteRow()
is
that deleteNode()
will remove recursively all
child nodes before removing the node identified by index.
If the index is zero, all root nodes will be deleted from the tree.