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

RadPanelBar Expand/Collapse

5 Answers 192 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
balaji
Top achievements
Rank 1
balaji asked on 10 Feb 2011, 07:07 AM
Hi,

I'm trying to do expand/collapse in ClientSide with

 function collapseAll() {
            var panelBar = $find("<%= RadPanelBar1.ClientID %>");
            var items = panelBar.get_items();
            for (var i = 0; i < items.get_count(); i++) {
                var item = panelBar.findItemByText(items.getItem(i).get_text());
                if (item) {
                    item.collapse();
                }
            }

It works fine with Firefox but its been very slow with IE. Please suggest any work around for this.

regards,
Baaje

5 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 14 Feb 2011, 12:32 PM
Hi balaji,

I'm afraid that this is the only way to collapse all the items. However you can modify the following code:

var item = panelBar.findItemByText(items.getItem(i).get_text());

to:

var item = items.getItem(i);

Hope this helps.

Best wishes,
Yana
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
balaji
Top achievements
Rank 1
answered on 14 Feb 2011, 01:36 PM
Hi yana,

thanx for your reply. but it doesn't help me in performance still its same.


regards,

Baaje
0
Yana
Telerik team
answered on 15 Feb 2011, 03:02 PM
Hello Baaje,

Please send us a live url where we can observe this behavior.

Greetings,
Yana
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Waseem
Top achievements
Rank 1
answered on 19 Apr 2013, 10:18 PM
Hi yana

How to check, if any item is expanded or collapse.
so if item is collapse , we can expand it. if item is expand , we collapse it.

 <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server" >
                    <script type="text/javascript">
                        $telerik.$(document).ready(function() {
                            $telerik.$(".rpExpandHandle").click(function() {
                                var panelBar = $find("<%= radPanelBar.ClientID %>");
                                if (  ) { //if it is collapse then expand it otherwise collapse it.
                                    panelBar.get_items().getItem(0).expand();
                                }
                                else {
                                    panelBar.get_items().getItem(0).collapse();
                                }
                             });
                        });
                    </script>
                </telerik:RadCodeBlock>

Thanks,
the telerik team
0
Waseem
Top achievements
Rank 1
answered on 19 Apr 2013, 11:06 PM
I got a solution, by making isExpanded true , so it solve my problem. 
         
      <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server" >
                    <script type="text/javascript">
                        var isExpanded = true;
                        $telerik.$(document).ready(function() {
                            $telerik.$(".rpExpandHandle").click(function() {
                                var panelBar = $find("<%= radPanelBar.ClientID %>");
                                if (isExpanded == true) {
                                    panelBar.get_items().getItem(0).collapse();
                                    isExpanded = false;
                                }
                                else {
                                    panelBar.get_items().getItem(0).expand();
                                    isExpanded = true;
                                }
                            });
                        });
                    </script>
                </telerik:RadCodeBlock>

Thanks.
Muhammad Waseem
the telerik team
Tags
PanelBar
Asked by
balaji
Top achievements
Rank 1
Answers by
Yana
Telerik team
balaji
Top achievements
Rank 1
Waseem
Top achievements
Rank 1
Share this question
or