Grid sorting only works on first column

Hi Folks,

I’m trying to figure out why sorting columns in a grid is only working with the first column. Here is the code:

var jobs_grid = jobs_layout.cells('a').attachGrid(); jobs_grid.setImagePath(DHTMLXPath + "/imgs/"); jobs_grid.setEditable(false); jobs_grid.setHeader("Id, Date, Time, Client Name, Client IP Address, Client User, Input Size, Input Read, Page, Status, Ruleset, Driver, Message"); jobs_grid.setInitWidthsP("8,8,8,7,12,7,7,7,5,6,10,7,8"); jobs_grid.setColSorting("int, date, date, str, str, str, str, str, str, str, str, str, str");

The sort arrow appears in all columns when clicked, but the first column is the only one that actually does any sorting.

I’m also wondering if there is a sort type for time.

Any help would be much appreciated.

Thanks,

Daryl

Please, try to remove spaces before the name of the sorting type:
jobs_grid.setColSorting(“int,date,date,str,str,str,str,str,str,str,str,str,str”);

Unfortunately there is no ready sorting type for the time. But you may create your own custom sorting type.
Here you can find an example of creating a custom “time” sorting type:
docs.dhtmlx.com/doku.php?id=dhtm … me_sorting

Thank you sematik, that fixed the problem. Much appreciated.

Regards,

Daryl