on 07-09-2008 3:53 PM
Hi All,
I am using TreeByNestingTableColumn element to display the tree hierarchy .
Does anyone knows how to implement Collapse All and Expand All functionality for this tree (if someone have sample code for these functionality then it will be great for me) ?
Thanks in advance.
Ravi.
Thanks for your reply ,
I am using the following node structure for displaying my hierarchy.
Hierarchy -
> node .
|
RecursiveHierarchy -
> recursive node .
lets suppose using this I have following tree.
Root -
> it is stored in <Hierachy> node
|
Child1 -
> it is stored in <Hierachy1.RecursiveHierarchy1>
Child2 -
>it is stored in <Hierachy1.RecursiveHierarchy2>
|
Grandchild2----
>it is stored in<Hierachy1.RecursiveHierarchy2.RecursiveHierarchy1>
Now for this example your code wont work .... so please do you have any idea how can I apply code to this sort of tree ?
Regards,
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Ravindra Sahu,
Code for EXPAND ALL button:
*step 1:Access node
lo_nd_tree_hierarchy = wd_context->get_child_node( name = wd_this->wdctx_tree_hierarchy ).
*step2: Extract all the table entries from node which is binded to table
lo_nd_tree_hierarchy->get_static_attributes_table(
IMPORTING
table = lt_tree_hierarchy ).
*step3:set element attribute Expanded to abap_true
loop at lt_tree_hierarchy ASSIGNING <ls_tree_hierarchy>.
<ls_tree_hierarchy>-expanded = abap_true.
endloop.
*step4: Finally the updated data needs to be binded.
lo_nd_tree_hierarchy->bind_table( lt_tree_hierarchy ).
Code for COLLAPSE ALL button:
*step 1:Access node
lo_nd_tree_hierarchy = wd_context->get_child_node( name = wd_this->wdctx_tree_hierarchy ).
*step2: Extract all the table entries from node which is binded to table
lo_nd_tree_hierarchy->get_static_attributes_table(
IMPORTING
table = lt_tree_hierarchy ).
*step3:set element attribute Expanded to abap_true
loop at lt_tree_hierarchy ASSIGNING <ls_tree_hierarchy>.
<ls_tree_hierarchy>-expanded = abap_false.
endloop.
*step4: Finally the updated data needs to be binded.
lo_nd_tree_hierarchy->bind_table( lt_tree_hierarchy ).
Please don't forget giving REWARD points...:-)
Edited by: Bharath Komarapalem on Jul 11, 2008 9:17 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.