cancel
Showing results for 
Search instead for 
Did you mean: 

Delete an Element in the Tree

Former Member
0 Kudos

Hi,

I would like to delete an element in the tree.

but I was able to delete only the rootNode

Could you help me. thanks

-


IPrivateTreeView.ITreeNodeNode rootNode =

wdContext.nodeTreeNode();

IPrivateTreeView.ITreeNodeElement level2Delete = null;

level2Delete = rootNode.currentTreeNodeElement( );

// I would like to do somethink like that

level2Delete.REMOVE_ELEMENT

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Philippe,

it's sooooo easy This is a snipped from the IWDNode API

  /**
   * Removes an element from the node collection. If an ICMIObservableList is
   * bound to the node, this list is modified!
   * @param element The element to be removed
   * @return <code>true</code> if the element was in.
   */
  boolean removeElement(IWDNodeElement element);

so you simply have to call

wdContext.nodeTreeNode().removeElement(level2Delete);

Hope that helps.

Regards

Stefan