SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need a feature (shown in images below). The feature is available for Older versions but not for 2010. Is it possible to get Expand/Collapse buttons for any 2010 list?

The examples given below uses this jQuery Script

share|improve this question
Which script added those +/- signs? Is it available freely? If so, you should simply try adding a new CEWP with the same scripts - they might plain and simple work! – Marius Constantinescu - MVP Jul 23 '12 at 14:01
Its a jQuery Script – neo269 Jul 23 '12 at 16:34
up vote 1 down vote accepted

Bill Simser has a JQuery script that does this here

It could be easily ported once same elements have been identified.

share|improve this answer
@saumilm - Did you port it? How did it work for you? – bgmCoder Jul 24 '13 at 22:16

You can use the "Group By" option when modifying or creating a view on the list. This will create these expand/collapse nodes.

List View - Group By option

share|improve this answer
You are right, but I believe he meant the little +/- buttons on the toolbar which most likely are added via Javascript. – Marius Constantinescu - MVP Jul 23 '12 at 14:00
Oh wow lol, I didn't even see those in the picture. – RJ Cuthbertson Jul 23 '12 at 14:06
@C.Marius That's Correct! I wanted +/- buttons so that I can expand or collapse all groups by one click. Is that possible? – neo269 Jul 23 '12 at 16:36
Yes, of course, update your Question with location of the script if that is available freely, or you shall most likely receive alternatives – Marius Constantinescu - MVP Jul 24 '12 at 7:49
Updated the question with the code! – neo269 Jul 24 '12 at 10:45

Here is how I've solved this, if you've used the "Group By" feature for the list. I add this code, perhaps, in a CEWP:

//This will auto-expand a list that has grouping set on it.
//set collapsemode to 1 to collapse everything; set it to 0 to expand everything.
function AutoExpandList(collapsemode){
    if (collapsemode) {
    } else {

Then, if I want expand and contract buttons, I add some buttons...

<a href="#" id="expandall">Expand All</a>
<a href="#" id="contractall">Contract All</a>

and then add this jQuery code to attach a function to those "buttons":

//set up expand and contract buttons for certain lists
function setupcontractors(){

Now I've got two clickable "buttons" that will expand or contract all the groups in the list. It works for any list.

share|improve this answer

Your Answer


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.