Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Is there a way to add a button to a SharePoint 2010 page to expand all grouped items in all the list views on the page? This is the first (top) level grouping only, not the second level. These are simple (standard) list views created via the web UI, where we've grouped items on one or two columns. Thanks.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

Yes this is possible. You can use some javascript to do that. Here is a post about this. http://alectang.com/blog/archive/2010/09/09/easy-expand-or-collapse-sharepoint-list-in-group-by-view.aspx

The trick is to find the little minus button and then click it:

function expandGroups() { 
    $("img[src*='plus.gif']:visible").parent().click();
}
share|improve this answer
    
Thanks, SPSinan. What if I have two levels of grouping and need all to be expanded? –  Alex C Dec 14 '11 at 15:06
    
Found the answer: Just remove the :visible from the statement and it works on the hidden grouped elements too :) –  Alex C Dec 15 '11 at 4:41
    
Thanks for sharing the solution ;) –  SPSinan Dec 15 '11 at 9:04
    
Tried this in SP 2010. Could not get it to work. Thanks anyway. –  Clem Jan 4 '12 at 13:13
    
@Clem Do you get an error message or something? –  SPSinan Jan 5 '12 at 9:11
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.