Open ibayer opened 7 years ago
The results are being sorted as strings, not as numbers. To fix, you could replace the comparer
function in the example with
function convert_to_float(x) {
var converted = parseFloat(x);
return isNaN(converted) ? x : converted
}
function comparer(a, b) {
var x = convert_to_float(a[sortcol]), y = convert_to_float(b[sortcol]);
return (x == y ? 0 : (x > y ? 1 : -1));
}
Hi, thanks for this awesome library! I just started playing around with the examples and have the impression that column sorting doesn't work properly for the slickgrid example.
Sort the![bildschirmfoto vom 2016-09-07 10 26 37](https://cloud.githubusercontent.com/assets/1497140/18304971/aa96488e-74e5-11e6-8ec5-99a161dae725.png)
fiber(g)
column in increasing order works.Sort the![bildschirmfoto vom 2016-09-07 10 28 27](https://cloud.githubusercontent.com/assets/1497140/18305023/d95949be-74e5-11e6-94d7-b611e16737e5.png)
fiber(g)
column in decreasing order doesn't work. The selected top data point is clearly not the highesfiber(g)
value in the plot.Any idea what goes wrong? I would really like to use this example. Any help to fix this would be very welcome.
Thanks