Hey!
First of all great product!
I have run into a small problem with the sorting of the data inside the grid.
I fetch the data using WCF Data Service and custom functions to filter the data.
A function could look like this:
I have also used the Data Service JSONP extension (http://archive.msdn.microsoft.com/DataServicesJSONP ) to make it work as described in many posts.
Everything works as intended except the "Order By c.fldEmail" in my Search Function.
The output will always be ordered by the id field when it's converted to JSON.
I know i can add $orderby to sort it but this is not the functionality i'm looking for as i might want to sort data based on related tables in the database.
What is causing this and how do I fix it?
This is my kendo datasource - works as intended:
A small bonus question :)
Is it possible to sort by a column at load? (not really important if i can get above to work)
Best regards and thanks in advance!
Stefan
First of all great product!
I have run into a small problem with the sorting of the data inside the grid.
I fetch the data using WCF Data Service and custom functions to filter the data.
A function could look like this:
<WebGet()> _
Public
Function
Search(price
As
Integer
)
As
IQueryable(Of tblCustomers)
Dim
context
As
OnlmCRMEntities =
Me
.CurrentDataSource
Try
Dim
customers = From c
In
context.tblCustomers
Where c.fldActive =
True
_
And
c.tblCustomerProducts.Any(
Function
(s) s.fldPrice = price
And
s.fldActive =
True
)
Order By c.fldEmail
Select
c
Return
customers
Catch
ex
As
Exception
Throw
New
ApplicationException(
"An error occurred: {0}"
, ex)
End
Try
End
Function
I have also used the Data Service JSONP extension (http://archive.msdn.microsoft.com/DataServicesJSONP ) to make it work as described in many posts.
Everything works as intended except the "Order By c.fldEmail" in my Search Function.
The output will always be ordered by the id field when it's converted to JSON.
I know i can add $orderby to sort it but this is not the functionality i'm looking for as i might want to sort data based on related tables in the database.
What is causing this and how do I fix it?
This is my kendo datasource - works as intended:
dataSource: {
type:
"odata"
,
transport: {
read: pathname +
"/model/WcfData.svc/Search?price=6000"
},
pageSize: 20,
serverPaging:
true
,
serverFiltering:
true
,
serverSorting:
true
}
A small bonus question :)
Is it possible to sort by a column at load? (not really important if i can get above to work)
Best regards and thanks in advance!
Stefan