Kendo-angular: The toODataString function don't generate the GroupBy clause

Created on 10 Jul 2017  路  6Comments  路  Source: telerik/kendo-angular

As mentioned at https://github.com/telerik/kendo-angular/issues/45#issuecomment-253730074, i try to use the groupping functionality in Grid, but the toODataString(state) function from @progress/kendo-data-query package apparently don't create the groupby OData specification.
It just ignore it.

Sample:

var state = JSON.parse(`{"skip":0,"take":10,"filter":{"filters":[{"field":"DataEncerramento","operator":"gte","value":"2017-07-01T04:00:00.000Z"},{"field":"SegredoJustica","operator":"eq","value":true}],"logic":"and"},"sort":[{"dir":"desc","field":"DataEncerramento"},{"dir":"asc","field":"IdProcesso"}],"group":[{"field":"SegredoJustica"}]}`);

var queryStr = toODataString(state);

console.log(queryStr);
//"$skip=0&$top=10&$filter=(DataEncerramento ge 2017-07-01T00:00:00.000Z and SegredoJustica eq true)&$orderby=DataEncerramento desc,IdProcesso"

//Don't have the "$apply=groupby((SegredoJustica))"

Most helpful comment

@hidegh
What @rkonstantinov is saying is that the GroupBy is not part of the CORE odata uri specification.
And it is right, the groupby is part of an EXTENSION of odata spec (look the ext at your uri).
But i believe that it should be done anyway (don't matter if is core or extension). Specially because the Grid component has the groupby feature and can mislead the developer to think that the toODataString take care of it.

All 6 comments

As far as I'm aware the groupby is not part of the core OData URI specification. This is why it is not added to the toODataString implementation.
If you believe such support should be added, please feel free to submit it to our uservoice portal here.

@hidegh
What @rkonstantinov is saying is that the GroupBy is not part of the CORE odata uri specification.
And it is right, the groupby is part of an EXTENSION of odata spec (look the ext at your uri).
But i believe that it should be done anyway (don't matter if is core or extension). Specially because the Grid component has the groupby feature and can mislead the developer to think that the toODataString take care of it.

@jvitor83 exactly, also possibly it's not even a big work to add that there, cause the grid State does have these details already, just toOdataString is ignoring it. It's weird that the answer I got on my ticket was a ref. to this one, cause it's closed (OK, not a won't do, yet a solution in the near future does not seems to be avail.) Anyhow here's the link to vote on it: vote for it here

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JaapMosselman picture JaapMosselman  路  28Comments

masterjs picture masterjs  路  25Comments

simon11196 picture simon11196  路  17Comments

alexeykostevich picture alexeykostevich  路  16Comments

simon11196 picture simon11196  路  17Comments