I have a grid with OrderID and OrderDate. The sorting is done on the server. The initial load is sorted on the OrderID.
The grid gets the data in JSON format.
How do I specify that the sort field and direction are null then by default show the sort icon on OrderID and Default direction is ASC?
Thank you
Vin
The grid gets the data in JSON format.
How do I specify that the sort field and direction are null then by default show the sort icon on OrderID and Default direction is ASC?
Thank you
Vin
6 Answers, 1 is accepted
0

Andrii
Top achievements
Rank 1
answered on 12 Apr 2012, 02:41 PM
Interested in the same question: how to set the default sorting for the grid (both on UI and on server datasource)?
0

Maksym
Top achievements
Rank 1
answered on 13 Apr 2012, 07:28 AM
Found this question via search.
I also want to know the answer to this question: "How to specify default sorting order for grid with server side sorting and pagination"?
I also want to know the answer to this question: "How to specify default sorting order for grid with server side sorting and pagination"?
0

Kyle
Top achievements
Rank 1
answered on 19 Apr 2012, 08:05 PM
I would like to know this as well. Specifically how to have the Kendo UI grid in a sorted started by default.
0

Ernie
Top achievements
Rank 1
answered on 27 Apr 2012, 07:57 PM
Same here. I noticed that there are 3 states happening on the sortable columns (desc, asc, null). My issue is if I have been clicking on the column, and I'll go into the null state, I don't know where to get the sortfield name that just been clicked since its already null. By the way, I'm doing server-side sorting.
Any ideas?
Any ideas?
0

Ernie
Top achievements
Rank 1
answered on 27 Apr 2012, 09:06 PM
Ok, my issue is different I guess. There is an option in the sortable to disallow the null state:
sortable: { mode: "single", allowUnsort: false }
0

Dave
Top achievements
Rank 1
answered on 31 May 2012, 05:01 PM
You can set the sort property on your dataSource to whatever you want. For example:dataSource: { type: "json", : : sort: { field: "OrderID", dir: "asc"}, : : }