Allow showing an empty set of default groups
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:
options = {
...,
grouping: true,
groupingView: {
groupField: ['profile.status'],
groupDataSorted: true,
groupColumnShow : [false],
groupText : ['<b>{0} ({1})</b>'],
groupNames: ['ACTIVE', 'APPROVED', 'PENDING', 'DRAFT', 'RETIRED'],
showEmptyGroups: true
},
...
}
I have implemented this on my forked version of jqGrid:
https://github.com/jeffmay/jqGrid/commit/c08d56e69a000a09515e655c2019f450e247583d
To be considered
Hi Jeff, I'm working on a project which also requires showing empty groups in a grid. I'm wondering if you made this work combined with paging feature of jqGrid.