Hi
I'm trying to set up group management in a grid.
In my case, I'm
- in ASP.NET MVC
- with dynamic grid (Html.Kendo().Grid<dynamic>)
- full server side operations :
grid.DataSource(dataSource => dataSource
.Custom()
.Type("aspnetmvc-ajax")
.Transport(t => t.Read(read => read.Action("ReadData", "Grid").Type(HttpVerbs.Post)))
.GroupPaging(true)
.Batch(false)
.AutoSync(true)
.PageSize(10)
.Schema(s => s.Data("Data").Total("Total").Model(model => ...))
.ServerFiltering(true)
.ServerGrouping(true)
.ServerPaging(true)
.ServerSorting(true)
I read the following thread which looks a bit like my problem:
https://www.telerik.com/forums/how-do-i-perform-server-side-grouping-and-aggregating
and the answer :
https://demos.telerik.com/aspnet-mvc/grid/customajaxbinding
I was inspired by this to make a POC.
In my grid/ReadData(request), I have something like that
DataSourceResult result = <get data>;
if (!request.Groups.Any()) return result; // No Group
// One group
return newDataSourceResult{
Data=new List<AggregateFunctionsGroup>{
new AggregateFunctionsGroup
{
Key = "Value", Member = request.Groups[0].Member, Items = result.Data
}},
Total=result.Total;
}
Of course, in my test, all rows have the value "Value" in the grouping column.
At runtime, the first time, without group, everything is OK : I have my first 10 records from the table (which has several thousand records)
I drag and drop the column in the grouping bar, and it's ok too : I have my accordion bar with the good column/value
But, when I open the accordion, I have an issue :
Uncaught TypeError: Cannot read property 'notFetched' of undefined
kendo.all.js:8374 if (lastItem.notFetched) {
I tried again by not returning the Items in AggregateFunctionsGroup
On open, I receive a readata with a filter corresponding to my column / value and I return my data
(the same as during the first execution because all my rows have the same value in the grouping column)
And I have the same issue.
At start, I was with Kendo 2021 R2. But as I saw that there was a fix on this subject, I preferred to install the latest version (R3),
but of course with the same result.
Can you tell me if I am returning bad Data (or Total ?), or if the bug (of R1) is still there?
Unless groups don't work with grid<dynamic>?
Maybe it is necessary to return all the records in the "Item", and not just the first 10? (in my case, several thousand)
Regards