Set a default sort column in SlickGrid

podcastfan88 picture podcastfan88 · Mar 20, 2012 · Viewed 11.6k times · Source

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?

Answer

Tim picture Tim · Mar 20, 2012

On the latest version you could do this:

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

You can also set multiple with setSortColumn*s*