My jqGrid contains a special column whose value is generated by another value, like the Duration Span column, its real value is in seconds like 3690s, and I should transform it to a formmatted string 'Hour : Minute : Second', in this cause it is '1:1:30'. Now, I want to it works well in sortting, so I write a customize function to handle this:
1, Following code fragment is column definition:
{
name : 'time',
index : 'time',
align: 'center',
width : '12%',
sorttype : sortTimeFuc
}
2, Following code fragment is sort function:
var sortTimeFuc = (function(cell) {
var a = cell.split(':');
var value = parseInt(a[2]) + parseInt(a[1]) * 60 + parseInt(a[0]) * 3600;
return value;
});
But it work incorrectly as below:
Can anybody gives me help? Thanks so much.