This is a migrated thread and some comments may be shown as answers.

When a panel is already expanded using...("tPanelBar").expand...stops all expand/collapse behavior for the panel

0 Answers 28 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Arnold Smith
Top achievements
Rank 1
Arnold Smith asked on 15 Feb 2011, 01:22 AM
Hi Telerik Experts,

I'm using several unrelated PanelBars in an ASP.NET MVC 2 application. I'm using them like collapsible DIVs. I added two buttons at the top of the page: "Expand All" and "Collapse All". Here is the markup:


<input id="btnExpandThis" type="button" value="Expand This" title="Expand This" onclick="ExpandCollectionInformation();" />

<input id="btnCollapseThis" type="button" value="Collapse This" title="Collapse This" onclick="CollapseCollectionInformation();" />


I'm trying to get just one PanelBar to work, so I'm practicing on #pnlCollectionInformation at this point. Here is the markup:

<% Html.Telerik().PanelBar()


















new { style = "text-align:left"




.Effects(fx => fx.Expand()








 .Items(items =>









"Collection Information"




.Content(() =>







<table width="100%">






<td class="display-label" style="width:24%">



Permanent Collector:







<td class="display-field">



<%Html.DisplayFor(model => model.CollectionData.Collector)%>















My javascript looks like this:

 <script type="text/javascript">


function ExpandCollectionInformation() {



'#pnlCollectionInformation').data("tPanelBar").expand('#pnlCollectionInformation > li');




functionCollapseCollectionInformation() {



'#pnlCollectionInformation').data("tPanelBar").collapse('#pnlCollectionInformation > li');







This code works nearly perfectly except for one issue. If I click on  btnExpandThis when #pnlCollectionInformation is NOT expanded, then the expand/collapse behavior stops working for that PanelBar. The PanelBar itself also becomes unresponsive to a mouse click.

How can I correctly implement the expan/collapse behaviors?

Thank you!

Arnold Smith

Asked by
Arnold Smith
Top achievements
Rank 1
Share this question