Hello,
I found a bug when process a group with null value.
This is the example that doesnt work: https://stackblitz.com/edit/react-hmnv9d?file=app%2Fmain.jsx
The first group with field 'estadoDenominacion' value 'null' is not rendering.
The response string in the products-loader.jsx is an example of our .NET Core API, our backend is something like this:
using Kendo.Mvc;
using Kendo.Mvc.Extensions;
using Kendo.Mvc.UI;
public DataSourceResult Get([DataSourceRequest] DataSourceRequest requestl)
{
return Repository.Get().ToDataSourceResult(request);
}
The Kendo.MVC library we are using are: Telerik.UI.for.AspNet.Core 2021.2.511
I found the method: translateDataSourceResultGroups use the key field of the response to build a group object but if the field is null or undefined, then use undefined as value, and in this case, the value of the first group must be null.
here do yoyu have a snippet of your library:
// utils.js
var isPresent = function (value) { return value !== null && value !== undefined; };
// deserialization.js
var valueOrDefault = function (value, defaultValue) { return isPresent(value) ? value : defaultValue; };
var normalizeGroup = function (group) { return ({
aggregates: group.Aggregates || group.aggregates,
field: group.Member || group.member || group.field,
hasSubgroups: group.HasSubgroups || group.hasSubgroups || false,
items: group.Items || group.items,
value: valueOrDefault(group.Key, valueOrDefault(group.key, group.value))
}); };
The value is returning undefined because group.value is undefined (doesnt exist in the response).
Thanks!