Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set a default sort column in SlickGrid

I'm using SlickGrid with DataView and I'm trying to set a default sort column on my table. Is there a way to trigger the sort or set an option so the column is sorted on load?

like image 257
podcastfan88 Avatar asked Mar 20 '12 15:03

podcastfan88


2 Answers

On the latest version you could do this:

grid.setSortColumn("myColId",true); //columnId, ascending

You can also set multiple with setSortColumn*s*

like image 168
Tim Avatar answered Oct 15 '22 04:10

Tim


See my solution here. This applies sort on a column initially without using Dataview.

Calling sort on slickgrid

I think it does what you want.

Btw since you are using Dataview. You can also give this a try. But I have not personally tried this.

    dataview.reSort() 
like image 21
Mr.Hunt Avatar answered Oct 15 '22 02:10

Mr.Hunt