tonytomov/jqGrid — Issue #201: Allow showing an empty set of default groups
Author: jeffmay
Created: 2011-11-29 21:46:58+00:00
State: open

jqGrid allows for creating groups based on the data, but if the user already knows what the groups will be, they have no way of specifying which ones should be visible (even if they are empty).

To make things simple, I propose we add a `groupingView.groupNames` as well as a `groupingView.showEmptyGroups` option, so that the user can specify the groups they know will be present and whether they would like those groups to be visible if they are empty.

For example:

I am using jqGrid to display a list of profiles (nevermind what they are, because it is complicated) grouped and sorted by their status (from top to bottom: 'ACTIVE', 'APPROVED', 'PENDING', 'DRAFT', 'RETIRED'). After doing some user testing, we found that users who performed an action to update the status of an item (either up or down) could not easily tell what status the item would move to, since they could not see the empty groups.

I would like to be able to show the empty groups by using:

```javascript
options = {
...,
grouping: true,
groupingView: {
groupField: ['profile.status'],
groupDataSorted: true,
groupColumnShow : [false],
groupText : ['{0} ({1})'],
groupNames: ['ACTIVE', 'APPROVED', 'PENDING', 'DRAFT', 'RETIRED'],
showEmptyGroups: true
},
...
}
```