1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / "Expand All" not working for Expandable Lists

"Expand All" not working for Expandable Lists

9 posts, 0 answered
  1. Jeff Mah
    Jeff Mah avatar
    31 posts
    Registered:
    25 Feb 2005
    12 Dec 2008
    Link to this post
    In IE, the "Expand All" option for Expandable lists does not work but it does work fine in Firefox. Is there a fix available for this?
  2. Jeff Mah
    Jeff Mah avatar
    31 posts
    Registered:
    25 Feb 2005
    15 Dec 2008
    Link to this post
    This appears to be happening as the javascript call exceeds the 2083 char limit for IE. Is there a workaround or fix for this?
  3. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    15 Dec 2008
    Link to this post
    Hi Jeff,

    Unfortunately, we cannot reproduce the described behavior locally. So we need further assistance to figure out what is wrong:
    1. What are the steps for reproducing the issue?
    2. Which is the exact Sitefinity version you are using?
    3. Which version of IE browser do you use?


    Also, it will be very helpful if you provide us with a link illustrating the issue.

    Thanks for your cooperation in advance.

    Best wishes,
    Pepi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  4. Jeff Mah
    Jeff Mah avatar
    31 posts
    Registered:
    25 Feb 2005
    19 Dec 2008
    Link to this post
    1. I created a list and added 16 items to it, added the list control to a page and select the list I created, navigate to that page in the live site and try to click "Expand All" (http://uat2.iomer.com/Sitefinity3.5Test/Services.aspx)
    2. The "Telerik.Cms.dll" version is 3.5.1747.2
    3. My IE version is 7.0.6001.18000
  5. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    19 Dec 2008
    Link to this post
    Hi Jeff,

    Thanks a lot for your kind assistance.
    It seems the problem is specific for IE browser. As a workaround please try to modify ~/Sitefinity/ControlTemplates/Lists/ExpandableListTemplate.ascx template as follows:

    <%@ Register Assembly="Telerik.Cms.Web.UI" Namespace="Telerik.Cms.Web.UI" TagPrefix="sfWeb" %> 
     
    <sfWeb:CssFileLink ID="CssFileLink1" FileName="~/Sitefinity/ControlTemplates/Lists/listsCommonLayout.css" Media="screen" runat="server" /> 
     
    <asp:Repeater ID="lists" runat="server"
        <ItemTemplate> 
            <h2 class="sf_listTitle"><asp:Literal ID="listTitle" runat="server"></asp:Literal></h2
             
            <class="sf_controlListItems" id="controlListItems"
                <id="expandAll" runat="server" onclick="toggleAllFixIE(true);"
                    <asp:Literal runat="server" Text="<%$Resources:ExpandAll %>"></asp:Literal> 
                </a> 
                <id="collapseAll" runat="server" style="display:none;" onclick="toggleAllFixIE(false);"
                    <asp:Literal runat="server" Text="<%$Resources:CollapseAll %>"></asp:Literal> 
                </a> 
            </p> 
             
            <asp:Repeater ID="listItems" runat="server"
                <HeaderTemplate> 
                    <ul class="sf_expandableList" id="expandableList"
                </HeaderTemplate> 
                <ItemTemplate> 
                    <li> 
                        <h3 id="headlineContainer" runat="server" class="sf_listItemTitle"
                            <id="headline" runat="server" title="<%$Resources:ClickToExpand %>"></a> 
                        </h3> 
                        <div id="contentContainer" runat="server" class="sf_listItemBody" style="display:none;"
                            <asp:Literal ID="content" runat="server"></asp:Literal> 
                        </div> 
                    </li> 
                </ItemTemplate> 
                <FooterTemplate> 
                    </ul> 
                </FooterTemplate> 
            </asp:Repeater> 
        </ItemTemplate> 
    </asp:Repeater> 
     
    <script language="javascript"
    function toggleAllFixIE(expandAll) 
        if (navigator.appName.indexOf('Microsoft') != -1) 
        { 
            var expandableList = document.getElementById('expandableList'); 
            var arrContentControls = expandableList.getElementsByTagName('div'); 
            var arrHeadlineControls = expandableList.getElementsByTagName('h3'); 
             
            for(i=0; i < arrContentControls.length; i++) 
            { 
                ctrlHeadline = arrHeadlineControls[i]; 
                ctrlContent = arrContentControls[i]; 
                if(ctrlContent != null) 
                { 
                    if(ctrlContent.style.display != 'none') 
                    { 
                        ctrlContent.style.display = 'none'
                        if(ctrlHeadline != null) 
                            ctrlHeadlinectrlHeadline.className = ctrlHeadline.className.replace('exp', ''); 
                    } 
                    else 
                    { 
                        ctrlContent.style.display = 'block'
                        if(ctrlHeadline != null) 
                            ctrlHeadline.className += 'exp'; 
                    } 
                } 
            } 
             
            var controlListItems = document.getElementById('controlListItems'); 
            var arrControlListItems = controlListItems.getElementsByTagName('a'); 
             
            if(expandAll) 
            { 
                arrControlListItems[0].style.display = 'none'
                arrControlListItems[1].style.display = 'block'
            } 
            else 
            { 
                arrControlListItems[0].style.display = 'block'
                arrControlListItems[1].style.display = 'none'
            } 
        } 
    </script> 

    Do let us know if this helps.

    Sincerely yours,
    Pepi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Jeff Mah
    Jeff Mah avatar
    31 posts
    Registered:
    25 Feb 2005
    19 Dec 2008
    Link to this post
    That works in IE7...there was a typo, though:

    if(ctrlHeadline != null)  
        ctrlHeadlinectrlHeadlinectrlHeadline.className = ctrlHeadline.className.replace('exp', '');   
     

    Should read:

    if(ctrlHeadline != null)   
        ctrlHeadline.className = ctrlHeadline.className.replace('exp', '');   
     
  7. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    20 Dec 2008
    Link to this post
    Hi Jeff Mah,

    Actually, the typo is caused by the "Format Code Block" tool of the editor. We are sorry for this.
    For your convenience we have attached the modified version of the ~/Sitefinity/ControlTemplates/Lists/ExpandableListTemplate.ascx file.

    All the best,
    Pepi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  8. Annie
    Annie avatar
    123 posts
    Registered:
    08 Apr 2009
    19 Feb 2010
    Link to this post
    Hi,

    we are having a similar problem with the expandable lists....I tried the fix that you provided it is not working for us

    Thanks,
    Annie

  9. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    22 Feb 2010
    Link to this post
    Hello Annie,

    Thank you for using our services.

    Could you please tell us which version of the CMS are you using? You can find a guide how to check your exact Sitefinity version in this article. The issue from this forum thread has been fixed and we have not been able to reproduce this in any browser. You can check this on our Demo Website. If you manage to reproduce the error, please give us a list of steps to do so and a link where we can observe this.

    The Expandable List uses JavaScript for its behavior. Make sure that you do not have any javascript errors on the page that could prevent the proper working of the Expandable List control.

    Greetings,
    Radoslav Georgiev
    the Telerik team

    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 Public Issue Tracking system and vote to affect the priority of the items.
Register for webinar
9 posts, 0 answered