ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: mikep on May 27, 2023, 05:33:34 pm
-
I have a number/int column and I'd like the rows with no data to be sorted last, rather than first, in the ascending sort.
-
Please use custom sorting:
sortType: function (rowData1, rowData2, dataIndx) {
var c1 = rowData1[dataIndx],
c2 = rowData2[dataIndx];
if (c1 > c2 || c1 == null) {
return 1;
}
else if (c1 < c2 || c2== null) {
return -1;
}
else {
return 0;
}
}
-
thank you that works. However when clicking the column header to sort, the columns are sorted in 4 different ways: ascending, descending, custom sort asc, custom sort descending. is there a way to only apply the custom sort when sorting ascending, so the user only toggles between 2 sorts: custom asc, and descending
-
Please set sortModel.cancel to false.
https://paramquery.com/pro/api#option-sortModel