Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Tanu Dua on Aug 12, 2009 23:56
open dhtmlx forum
Show sorting icon by default

Hi ,

I am using dhtmlXGridFromTable in one of the projects which uses the sorting.

By default , when the page is loaded , I want the sorting to be done on first column which I have implemented by using an API

mygrid.sortRows(0,"date","desc"); and as expected sorting is working fine.But , I also want a sorting icon to be displayed on the first column when the page gets loaded . I am getting icon only when I click the header.

Is there any way to show the sorting icon by default.

Thanks.
Answer posted by dhxSupport on Aug 13, 2009 02:05
To set sorting image you can use method setSortImgState(state, ind, order, row) where 
state - true/false - show/hide image
ind - index of column
order - asc/desc - type of image (optional, “asc” by default)
row - one based index of header row (used in multirow headers, top row by default)

 mygrid.setSortImgState(true,0,"des")