You are not the first person who have the problem. During answering on the question I had the idea how to modify the code of jqGrid and to introduce isInTheSameGroup
callback function which can be used to specify which items should be interpreted as identical. For example the most common case will be to ignore the time and to group the column with the datetime by date only.
In case of usage such isInTheSameGroup
callback it should be important to use another callback formatDisplayField
which shows how to display the grouping header. It's clear that if you place 01100000-8
, 01100303-4
and 01100003-9
in the same group then displaying of 01100000-8
as the grouping header would be not good. So one should use the callback formatDisplayField
to cut the displayed filed till the same first 5 digits which you use for grouping: 01100
.
I didn't tested, but I think that you should use something like the following
groupingView: {
...
formatDisplayField: [
function (displayValue) { //, value, cm, index, grp) {
return String(displayValue).substring(0, 5);
}
],
isInTheSameGroup: function (x, y) {
return String(x).substring(0, 5) === String(y).substring(0, 5);
}
}