Tree Table

Hi,
How to remove child component along with parent component when I try to delete parent component…? please do reply with the code…will be waiting for your response.

Thanks in advance.

Children are automatically removed when you remove the parent component from it’s parent. Could you clarify what you mean?

hi,
I am trying to delete child along with parent in tree table by removeItem(), but it will delete only parent row not child row …
can u pls tell how to delete that ?

thanks.

You need to remove the child elements first, e.g. recursively. So, before you delete the parent, dom something like

for(Object child: new HashSet<Object>(tree.getChildren(parent)){
   tree.removeItem(child);
}

If you have many levels of children, just make that a recursive method instead.