mleibman / SlickGrid

A lightning fast JavaScript grid/spreadsheet
http://wiki.github.com/mleibman/SlickGrid
MIT License
6.81k stars 1.97k forks source link

Slickgrid numeric sorting issue #1041

Open srinivs87 opened 9 years ago

srinivs87 commented 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)); }

tbindi commented 9 years ago

Not the right place to be asking for questions like these. Try http://stackoverflow.com/

DemersM commented 9 years ago

see this answer: http://stackoverflow.com/a/22562036/1914034