none
Which Javascript function is called when a grouped list is initially rendered, to expand groups that were previously expanded?

    Question

  • I have a list view on a page, and the list view is configured with groups that are initially collapsed.

    When the group is expanded, it is rendered dynamically on the page via Ajax.

    If you refresh the page or return to the page, the groups are displayed collapsed, and then the groups previously expanded are re-expanded dynamically after the page is rendered.

    I'm looking for the Javascript function that is called by SharePoint to re-expand all the previously collapsed groups.  Anyone know what that is?

    Wednesday, August 13, 2014 9:45 PM

Answers

All replies

  • Hi,

    According to your post, my understanding is that you wanted to know the Javascript function that is called by SharePoint to re-expand all the previously collapsed groups.

    Per my knowleadge, the page will be stored as the cookie. When you refresh the page, it will return to the previous status.

    To re-expand groups, it will call the ExpCollGroup() function.

    Thanks,

    Linda Li                

    Forum Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Linda Li
    TechNet Community Support

    Thursday, August 14, 2014 8:14 AM
    Moderator
  • Linda,

    Thanks - I figured out that ExpCollGroup does that, but I cannot determine *when* it is being called.

    I know it gets called when I click on a group to expand it.

    However, I am trying to execute some javascript on list items, and that works when I hook into ExpCollGroup when I click on a group to expand it. However, I cannot get it to work when the page is visited or refreshed and one or more of the groups are expanded based on the previous status.

    It appears that the page is rendered with all of the groups collapsed, then it must use the cookie to figure out what groups need to be re-expanded to their previous state.  I need to know when that function completes.

    I am using jQuery and using $(document).ready() is not working because the list items in expanded groups are not rendered on the page yet. It seems that that is being done asynchronously by some other function, and I need to know when that function completes. Any idea about that?

    Thursday, August 14, 2014 12:47 PM
  • Hi,

    I recommend to set Cookie using JQuery to store the status of the collapsed groups.

    More information:

    Warning: SetCookie changes implementation in SharePoint 2013

    Use jQuery & cookies in SharePoint

    Working with Cookies in jQuery

    Thanks,

    Linda Li                

    Forum Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Linda Li
    TechNet Community Support

    Tuesday, August 26, 2014 6:10 AM
    Moderator