Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregates broken ? #5

Closed
boisellea opened this issue Jun 25, 2019 · 4 comments
Closed

Aggregates broken ? #5

boisellea opened this issue Jun 25, 2019 · 4 comments

Comments

@boisellea
Copy link

Hi again,

I'm trying to use aggregates with your code without success.
Using :

schema: {
model: {
fields: {
id: { type: "number" }
}
},
data: "Data",
total: "Total",
aggregates: "Aggregates",
groups: "Group",
errors: "Errors"
},
serverPaging: true,
serverSorting: true,
serverFiltering: true,
serverAggregates: true,
pageSize: 100,
aggregate: [
{ field: "id", aggregate: "count" }
]

My webservice returns nothing, no error but nothing is returned at all.
By the way, in the exemple you gave, I think your WebMethod definition should be

[WebMethod]
public static DataSourceResult Products(int take, int skip, IEnumerable sort, Filter filter, IEnumerable aggregate, IEnumerable group)

instead of
[WebMethod]
public static DataSourceResult Products(int take, int skip, IEnumerable sort, Filter filter, IEnumerable aggregates, IEnumerable group)

Thank you.
Arnaud

@linmasaki
Copy link
Owner

Ok, thank you for your question, I will test it later.
If you don't mind, can you provide the version number of Kendo UI you use? Thanks 😊

@boisellea
Copy link
Author

Sure : Kendo UI v2019.2.514
Thanks a lot again.

@linmasaki
Copy link
Owner

linmasaki commented Jul 5, 2019

Hello, I just have updated this package, you can try it later.

P.S. Notice the property "Group" of DataSourceResult has changed to "Groups". More details you can see release notes.

@boisellea
Copy link
Author

boisellea commented Jan 13, 2020

Hi,

I did not had the chance to test your new version until today :

Using Kendo.DynamicLinqCore.2.2.2 and Kendo UI v2019.3.1023.

Aggregate still does not work :

var dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "https://xxx.com/Service.svc/GetCmds",
type: "POST",
dataType: "json",
contentType: "application/json"
},
parameterMap: function (data, type) {
if (type == "read") {
return JSON.stringify(data);
}
}
},
schema: {
model: {
fields: {
id_cmd: { type: "number" }
}
},
data: "Data",
total: "Total",
aggregates: "Aggregates"
},
serverPaging: true,
serverSorting: true,
serverFiltering: true,
serverAggregates: true,
pageSize: 25,
aggregate: [{ field: "id_cmd", aggregate: "count" }]
});

The request sent is :
{"take":25,"skip":0,"page":1,"pageSize":25,"aggregate":[{"field":"id_cmd","aggregate":"count"}]}

My webservice returns nothing, no error but nothing is returned at all.

Definition into the webservice :
Function GetCmds(ByVal skip As Integer, ByVal take As Integer, ByVal sort As IEnumerable(Of Sort), ByVal filter As Filter, ByVal aggregate As IEnumerable(Of Aggregator), ByVal groups As IEnumerable(Of Group)) As DataSourceResult

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants