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

PanelBar items don't expand after JavaScript Collapse

2 Answers 64 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Marcel
Top achievements
Rank 1
Marcel asked on 18 Dec 2015, 08:08 PM
I have the following code. When I expand the HydroTest panel bar it invokes the function HydroTestRadPanelBar_ItemExpand() , which collapses other panel bars which reside in other user controls (ASCX). This works, but after this, if I try to expand the collapsed panel bars using the UI, they will not expand. What am I missing?
<script type="text/javascript" id="telerikClientEvents1">
//<![CDATA[
 
    function HydroTestRadPanelBar_ItemExpand(sender,args)
    {
        var panelbar = $find(weld1UserControlWeldRadPanelBarClientID);
 
        for (var i = 0; i < panelbar.get_allItems().length; i++) {
            panelbar.get_allItems()[i].set_expanded(false);
        }
 
        var panelbar2 = $find(weld2UserControlWeldRadPanelBarClientID);
 
        for (var i = 0; i < panelbar2.get_allItems().length; i++) {
            panelbar2.get_allItems()[i].set_expanded(false);
        }
 
        var panelbar3 = $find(jointUserControlJointRadPanelBarClientID);
 
        for (var i = 0; i < panelbar3.get_allItems().length; i++) {
            panelbar3.get_allItems()[i].set_expanded(false);
        }
    }
 
//]]>
</script>

2 Answers, 1 is accepted

Sort by
0
Marcel
Top achievements
Rank 1
answered on 18 Dec 2015, 10:27 PM

This behavior occurred because I had the following structure in my PanelBar. Once I removed the extra <Items> and <PanelItems> the code worked as expected.

<telerik:RadPanelBar ID="RadPanelBar1" runat="server" ExpandMode="SingleExpandedItem" Width="900px" Height="84px">
    <Items>
        <telerik:RadPanelItem Text="Asset" Expanded="true" >
            <Items>
                <telerik:RadPanelItem Expanded="true">
                    <ContentTemplate>
                        <table style="width:100%; text-align:left">
                            <tr>
                                <td class="litHeader">

0
Ivan Danchev
Telerik team
answered on 23 Dec 2015, 02:09 PM
Hello,

Thank you for getting back to us. I am glad you managed to find the cause for the issue and the PanelBarItems are expanding correctly.

Regards,
Ivan Danchev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
PanelBar
Asked by
Marcel
Top achievements
Rank 1
Answers by
Marcel
Top achievements
Rank 1
Ivan Danchev
Telerik team
Share this question
or