I'd like the CollapsiblePanel to close when a treenode is clicked

C

Cal Who

The code below shows a CollapsiblePanel followed by an iframe.

When the CollapsiblePanel is opened and a treeNode within it is clicked, the
site shows in the iframe.

What I would like is for the CollapsiblePanel to close at that time (in the
real code the tree is very big).

Can you show how to do that?

Thanks

PS Is the way I've coded the iframe OK?





<ajaxToolkit:CollapsiblePanelExtender ID="CollapsiblePanelExtender1"
runat="server" TargetControlID="PnlContent" ExpandControlID="PnlTitle"
CollapseControlID="PnlTitle" TextLabelID="Label1" Collapsed="True"
SuppressPostBack="true">

</ajaxToolkit:CollapsiblePanelExtender>

<asp:panel ID="PnlTitle" runat="server">

SELECT A SITE BY CLICKING HERE

</asp:panel>

<asp:panel ID="PnlContent" runat="server">

<asp:TreeView ID="TreeView2" runat="server">

<Nodes>

<asp:TreeNode Text="SITES" Value="SITES">

<asp:TreeNode NavigateUrl="http://site1" Target="LinksFrame2"
Text="Site1"></asp:TreeNode>

<asp:TreeNode NavigateUrl="http://site2" Target="LinksFrame2"
Text="Site2"></asp:TreeNode>

<asp:TreeNode NavigateUrl="http://site3" Target="LinksFrame2"
Text="Site3"></asp:TreeNode>

</asp:TreeNode>

</Nodes>

</asp:TreeView>

</asp:panel>



<h4>

THE SITE SELECTED DISPLAYS BELOW</h4>

<%-- Must use name per test and documentation. --%>

<iframe name="LinksFrame2" src="MakeBlack.htm" frameborder="0"
height="700px" width="100%" style="background: inherit;">Your browser does
not support iframes.</iframe>
 
C

Cal Who

I can add and event to all the anchors with
<script type="text/javascript">

var links = document.getElementsByTagName('a');

for(var i=0;i<links.length;++i)links.onclick=function(){ alert("QQQQ");

return true;

}

</script>

That is it finds all anchors that are not in the PnlContent panel ( I didn't
show those) but the code ignore the ones in the panel.

Is there some recursion search that I can use or some other way to find the
anchors in the panel?

I looked at the source in the browser and the anchors are there the code is
just not finding them

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,708
Latest member
SherleneF1

Latest Threads

Top