This is a migrated thread and some comments may be shown as answers.

Grid Column Default Sort Image Column Issue

6 Answers 334 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vin
Top achievements
Rank 1
Vin asked on 18 Jan 2012, 06:00 AM
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

6 Answers, 1 is accepted

Sort by
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"?
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?
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"},
		:
		:
	}

Tags
Grid
Asked by
Vin
Top achievements
Rank 1
Answers by
Andrii
Top achievements
Rank 1
Maksym
Top achievements
Rank 1
Kyle
Top achievements
Rank 1
Ernie
Top achievements
Rank 1
Dave
Top achievements
Rank 1
Share this question
or