Open srinivs87 opened 9 years ago
This is the funtion i wrote for slickgrid numeric sorting. but this is not working properly what is wrong in this
function comparer(a, b) { var x = (isNaN(a[sortcol]) || a[sortcol] === "" || a[sortcol] === null) ? -99e+10 : parseInt(a[sortcol]); var y = (isNaN(b[sortcol]) || b[sortcol] === "" || b[sortcol] === null) ? -99e+10 : parseInt(b[sortcol]); return (x === y ? 0 : (x > y ? 1 : -1)); }
Not the right place to be asking for questions like these. Try http://stackoverflow.com/
see this answer: http://stackoverflow.com/a/22562036/1914034
This is the funtion i wrote for slickgrid numeric sorting. but this is not working properly what is wrong in this
function comparer(a, b) {
var x = (isNaN(a[sortcol]) || a[sortcol] === "" || a[sortcol] === null) ? -99e+10 : parseInt(a[sortcol]); var y = (isNaN(b[sortcol]) || b[sortcol] === "" || b[sortcol] === null) ? -99e+10 : parseInt(b[sortcol]); return (x === y ? 0 : (x > y ? 1 : -1)); }