sets a custom sorting
func | function | the function used for comparison |
col | number | the index of a column to apply the custom sorting to |
Available only in PRO Edition
//the second column is sorted by the number of symbols in the text
mygrid.setCustomSorting(sort_custom,1);
...
function sort_custom(a,b,order){
var n=a.length;
var m=b.length;
if(order=="asc")
return n>m?1:-1;
else
return n<m?1:-1;
}
the custom sort has three params:valueA,valueB,order; where the order can be "asc" or "des"
Back to top