-
Notifications
You must be signed in to change notification settings - Fork 22
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 #12
Comments
Yes, I saw your issue recently. I would check it and give you some samples for you ASAP after complete my private job. :) |
@boisellea Try the version package(v3.1.0). I think the missing aggregator parameter caused this problem, and I also add NUnit test cases for you to check! |
Hi CoCo, Thanks for that, however I still have the same problem/behavior : nothing is return from wcf webservice. The aggregates part of https://github.com/mshtawythug/dlinq-helpers works on my side, I don't know if it can be helpful for you. |
WOW, It is confused to me. Could you see my test sample to compare yours? Is there have any difference between the request data? Or any error messages? TKS~ |
I tried to simplify my code to the extreme, (eliminating passing parameters from the kendo grid) but still :
Public Function GetCmds2() As DataSourceResult Implements IService.GetCmds2
Using northwind = New charpakEntities
Return northwind.COMMANDES.OrderBy(Function(p) p.id_cmd).[Select](Function(p) New GetTestWCF2 With {
.id_cmd = p.id_cmd
}).ToDataSourceResult(JsonConvert.DeserializeObject(Of DataSourceRequest)("{""take"":10,""skip"":0,""aggregate"":[{""field"":""id_cmd"",""aggregate"":""sum""}]}"))
End Using
End Function
<KnownType(GetType(GetTestWCF2))>
Public Class GetTestWCF2
Private mid_cmd As Int32
Public Property id_cmd() As Int32
Get
Return mid_cmd
End Get
Set(ByVal value As Int32)
mid_cmd = value
End Set
End Property
End Class
The id_cmd field is an integer, primary field of the COMMANDES table.
EDIT : I don't have any error message, just no data at all.
I can’t see any difference between your code and mine except :
- I’m using vb.net
- I’m using .NET Standard 2.0
|
Hi, I found the error : According to Telerik here : https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/schema _The aggregate results should have the following format:
In my case, .ToDataSourceResult(JsonConvert.DeserializeObject(Of DataSourceRequest)("{""take"":10,""skip"":0,""aggregate"":[{""field"":""id_cmd"",""aggregate"":""sum""}]}")).Aggregates.ToString returns : "{ id_cmd = { sum = 108776131 } }" instead of : "{ id_cmd : { sum : 108776131 } }" |
Sorry, because I'm not very familiar with VB.net, I'm still trying to find possible points for the problem. In my case, ToDataSourceResult returned format is "{ id_cmd : { sum : 108776131 } }":confused:, could you give me a web console shot to display the whole result value to me? thanks! |
Since there has been no reply for a long time, so this issue is closed. |
Hi, I already commented your last version on previous closed topic.
Aggregates is not working on my side :
Using Kendo.DynamicLinqCore.2.2.2 and Kendo UI v2019.3.1023.
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.
The text was updated successfully, but these errors were encountered: