Hi,
I use the jqgrid v4.4.4, jQuery v2.1.1 and jQueryUI v1.10.0.
My application is in .NET MVC.
My controller code goes like this:
var allMyData = latestData.OrderbyDescending(x=>x.receivedDate).Select(
c=>new {c.RowId, c.Guid, c.Name, c.receivedDate, c.ItemGroup});
var jsonData=new {totalPages, page, totalRecords, allMyData.ToList(), IsLastPage};
return Json(jsonData,AllowRequestBehavior.AllowGet);
My JqGrid code:
funciton LoadGrid(){
$(function(){
$(myGrid).jqGrid({
url: “/controller/MyActionMethod”,
datatype:’json’,
cache:true,
colNames:[‘Id’,’Unique ID’,’Name’,’Received Date’,’Item Group’],
colModel:[{key: true, name: ‘RowId’,index: ‘RowId’, hidden: true},
{key : false, name: ‘Guid’, hidden: false},
{key : false, name : ‘Name’, hidden : false},
{key : false, name : ‘ReceivedDate’, hidden : false},
{key : false, name : ‘ItemGroup’, hidden : false}],
sortName: ‘ReceivedDate’,
sortorder: ‘desc’,
grouping: ‘true’,
groupView: {groupField: [‘ItemGroup’], groupDataSorted: true}
…..
});
});
}
In my case I have 6 ItemGroup under which 35 Items are there; in which 3 groups have 2 records each. Those three groups didn’t get duplicated. Remaining 3 groups have 29 records split among them. In these groups one group (ItemGroup2) have 8 records; 4 records are displayed in one group and 2 records in another group and remaining 2 in another group where the group names (titles) are same.
So the final display goes like this:
ItemGroup2
18910-28390-ASF109 – Name5 – 2020-10-14 16:00:57 – ItemGroup2
92A82-17328-83017 – Name3 – 2020-10-13 03:20:45 – ItemGroup2
92347-A8G82-U8120 – Name2 – 2020-10-13 01:05:15 – ItemGroup2
ItemGroup3
K29017-018X9-81029 – Name6 – 2020-10-12 20:04:27 – ItemGroup3
ItemGroup2
02963-G92370-7H203 – Name1 – 2020-10-11 12:20:45 – ItemGroup2
63017-U923M9-W1Y30 – Name2 – 2020-10-10 08:45:15 – ItemGroup2
Is there a way to eliminate the duplication and show all the records under the same group?
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top