RadPanelBar Expand/Collapse

6 posts, 0 answers
  1. balaji
    balaji avatar
    17 posts
    Member since:
    Dec 2010

    Posted 10 Feb 2011 Link to this post

    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

  2. Yana
    Admin
    Yana avatar
    4200 posts
    Member since:
    Sep 2012

    Posted 14 Feb 2011 Link to this post

    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.

  3. balaji
    balaji avatar
    17 posts
    Member since:
    Dec 2010

    Posted 14 Feb 2011 Link to this post

    Hi yana,

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


    regards,

    Baaje

  4. Yana
    Admin
    Yana avatar
    4200 posts
    Member since:
    Sep 2012

    Posted 15 Feb 2011 Link to this post

    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.

  5. <i class="forumsPostedByMVP">W</i>
    <i class="forumsPostedByMVP">W</i> avatar
    69 posts
    Member since:
    Jun 2012

    Posted 19 Apr 2013 Link to this post

    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

  6. <i class="forumsPostedByMVP">W</i>
    <i class="forumsPostedByMVP">W</i> avatar
    69 posts
    Member since:
    Jun 2012

    Posted 19 Apr 2013 Link to this post

    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

Back to Top