PanelBar items don't expand after JavaScript Collapse

3 posts, 0 answers
  1. Macrel
    Macrel avatar
    32 posts
    Member since:
    Aug 2008

    Posted 18 Dec 2015 Link to this post

    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. Macrel
    Macrel avatar
    32 posts
    Member since:
    Aug 2008

    Posted 18 Dec 2015 in reply to Macrel Link to this post

    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">

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ivan Danchev
    Admin
    Ivan Danchev avatar
    829 posts

    Posted 23 Dec 2015 Link to this post

    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
Back to Top