Passing the SortState through a URL

I thought it would be a nice feature to be able to pass a sort command from a URL. This way, I can send someone a link to the grid in the same state that I am viewing it.

I am using the mygrid.getSortingState() function to find which column is currently sorted and its sort direction. I place this into a “sort” parameter in my link (IE. company.com/?sort=4,des). Then I thought I could use the mygrid.setSortImgState and mygrid.sortRows functions to sort the grid on load with the URL information.

My problem is that I need to know that column sort method in order to pass the direction to the sortRows function (IE. mygrid.sortRows(4,“int”,“des”).

Is there any way to get the column sort type?

I figured out how to do it with a private property called fldSort[].

mygrid.setSortImgState(true,1,“des”);
mygrid.sortRows(1,mygrid.fldSort[1],“des”);

–brian

actually you can provide a null as second parameter - in such case grid will take active sorting type for the column in question.

Even better.