Tuesday, May 4, 2010

HOW TO Display Expand/Collapse icons in a SharePoint List

Insert the following code in a Content Editor Web Part to display +/- icons to expand/collapse Items in a SharePoint List. The icons will appear in the Actions Menu in the List.

<script type="text/javascript" src="/../JavaScript%20Library/jquery-1.2.6.min.js"></script>

<script type="text/javascript">

function collapseGroups() {



function expandGroups() {



$(function() {

var expandAll = "<a href='#' onClick="


+'"><img title="expand all groups" style="border:none;" alt="expand all" src="/_layouts/images/collapseplus.gif"></a>';

var collapseAll = "<a href='#' onClick="+'"'


+'"><img title="collapse all groups" style="border:none;" alt="collapse all" src="/_layouts/images/collapseminus.gif"></a>';




1 comment:

Clem said...

In SP2010, there is no actions menu on a list or doclib. It's necessary to add an href to the script to display links on the page for the user to click.