ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: queensgambit9 on March 03, 2016, 04:25:31 pm
-
hello
I have som empty cells in a column with datatype "integer"...these are not correctly sorted and mixes with '0' values in a not wanted way...is there a solution for this?
thanks
-
The other way is to use custom sorting:
http://paramquery.com/pro/api#option-column-sortType
-
thanks, however tried:
...
sortType: function(rowData1, rowData2, dataIndx){
//compare rowData1[dataIndx] and rowData2[dataIndx]
var c1 = rowData1[dataIndx],
c2 = rowData2[dataIndx]
//c1 = $.trim(val1).length,
//c2 = $.trim(val2).length;
if (c1 > c2) {
return 1;
}
else if (c1 < c2) {
return -1;
}
else {
return 0;
}
but can't get it to work...im not sure I understand how to implement it...
-
Sorry about that.
Custom sorting works only with strings, it has been corrected in upcoming version v3.3.0 ( hopefully would be launched by end of this week )