ReportingAnalyst
MIS
I built a tree as shown in this HTML code:
Code:
<form name="f" method=post>
<input type="radio" name="empid" id="empid" value="22979">
<a href="#" class="a_style" onclick="s_Hide('1472'); return false;">TopLevelMgr</a href>(22979)<br>
<span id="span" style="display: none">
****
<input type="radio" name="empid" id="empid" value="8208">
<a class="a_style" href="#" onclick="s_Hide('1703'); return false;">
Mgr1<font size=1>*(8208)</font>
</a><br>
********
<input type="radio" name="empid" id="empid" value="40801">
Subordinate1*<font size=1>(40801)</font>
<br>
********
<input type="radio" name="empid" id="empid" value="8089">
<a class="a_style" href="#" onclick="s_Hide('2109728'); return false;">
Mgr2<font size=1>*(8089)</font>
</a><br>
************
<input type="radio" name="empid" id="empid" value="8067">
Subordinate2*<font size=1>(8067)</font>
<br>
************
<input type="radio" name="empid" id="empid" value="28391">
Subordinate3*<font size=1>(28391)</font>
<br>
************
<input type="radio" name="empid" id="empid" value="8073">
Subordinate3*<font size=1>(8073)</font>
<br>
</form>
If you see this is a nested structure.
For the javascript:
Code:
<script type="text/javascript">
function s_Hide(el){
//obj = document.getElementById(el).style;
obj = document.getElementById('span').style;
(obj.display == 'none')? obj.display = 'block' : obj.display = 'none';
}
</script>
If I call this function from the toplevel manager, it collapses the entire tree and expands the entire tree through the onClick event. That works fine.
Similarly I would like to achieve this through the Sub Managers level as well. When I click on Mgr1, I should be able to expand and collapse the tree under Mger1. When I click the Sub Manager link, it collapses the entire tree instead of expanding or callapsing the sub-manager's tree of subordinates.
Any ideas as to how I can acheive the collapsing and expanding of the sub-managers without collapsing the topmanager tree?
Thanks.
Code:
<form name="f" method=post>
<input type="radio" name="empid" id="empid" value="22979">
<a href="#" class="a_style" onclick="s_Hide('1472'); return false;">TopLevelMgr</a href>(22979)<br>
<span id="span" style="display: none">
****
<input type="radio" name="empid" id="empid" value="8208">
<a class="a_style" href="#" onclick="s_Hide('1703'); return false;">
Mgr1<font size=1>*(8208)</font>
</a><br>
********
<input type="radio" name="empid" id="empid" value="40801">
Subordinate1*<font size=1>(40801)</font>
<br>
********
<input type="radio" name="empid" id="empid" value="8089">
<a class="a_style" href="#" onclick="s_Hide('2109728'); return false;">
Mgr2<font size=1>*(8089)</font>
</a><br>
************
<input type="radio" name="empid" id="empid" value="8067">
Subordinate2*<font size=1>(8067)</font>
<br>
************
<input type="radio" name="empid" id="empid" value="28391">
Subordinate3*<font size=1>(28391)</font>
<br>
************
<input type="radio" name="empid" id="empid" value="8073">
Subordinate3*<font size=1>(8073)</font>
<br>
</form>
If you see this is a nested structure.
For the javascript:
Code:
<script type="text/javascript">
function s_Hide(el){
//obj = document.getElementById(el).style;
obj = document.getElementById('span').style;
(obj.display == 'none')? obj.display = 'block' : obj.display = 'none';
}
</script>
If I call this function from the toplevel manager, it collapses the entire tree and expands the entire tree through the onClick event. That works fine.
Similarly I would like to achieve this through the Sub Managers level as well. When I click on Mgr1, I should be able to expand and collapse the tree under Mger1. When I click the Sub Manager link, it collapses the entire tree instead of expanding or callapsing the sub-manager's tree of subordinates.
Any ideas as to how I can acheive the collapsing and expanding of the sub-managers without collapsing the topmanager tree?
Thanks.