Is it possible to expand groups in a list based on a list value? We have a list grouped by country. There is a status column in this list with two possible properties ("completed" or "not started"). Now we want to add a view where all groups are expand only when the status is "not started". Is there a possibility to solve this 'problem'?
2 Answers
Go to where you can edit your list in sharepoint. While editing the list you would like to work on, there should be an option to filter the list elements that only meet a certain condition. From there, you can show only the elements that have "Not Started" in the status field.
-
Thanks for your hint, but it is necessary to see all items. Not only the items with the status "not started". Therefore we want to expand the group when the stauts is "not started"– TiacCommented Jun 4, 2014 at 11:08
Sharepoint stores list of expanded groups in cookie. So you can put to cookie your list of groups you want to expand.
var GROUP_DELIMITER = ";#";
function SetExpandedGroups(viewId, groups)
{
var encoded = groups.map(function(group)
{
return encodeURIComponent(GROUP_DELIMITER + group + GROUP_DELIMITER).replace(/%/g, "%25");
});
document.cookie = ExpGroupCookiePrefix + viewId + "=" + encoded.join("%26");
}
//example of use
var viewId = {C5C6F53D-41D5-449E-8E8B-59F1B8688393};
var groups = ["sunday", "monday", "tuesday"];
SetExpandedGroups(viewId, groups);