Hello,
In version 2.6 when sorting DESC,
-5 is higher than 0, which is mathematically false! (0 > -5)
Should be (-5 < 0)
Sorting is done by database ORDER BY clause, so make sure your field is numeric in order to sort numerically. If field is varchar, it will sort alphabetically. If it does not solve, please reopen ticket.
Nope. The same code, (in this case using “Load Array”).
When using v2.00 lib, works ok! https://imgur.com/a/Wl2U1z8
Column code:
$col = array();
$col[“title”] = “Saldo”; // caption of column
$col[“name”] = “{$row[‘partn_kodas’]}{$row[‘uzs_nr_skaita’]}_saldo”;
$col[“width”] = “70”;
$col[“sorttype”] = int;
$cols[] = $col;
I’ve emailed you latest build that is running on this working demo.
Thank You.
Maybe You could add 0 to column quantity in demo ?
and then check again?
Because in my case 0 is higher that negative numbers. And that is incorrect of course.
I’ve regenerated this issue. will update back.
Hello,
Sorting will work with sorttype => number,
$col = array();
$col[“title”] = “Quantity”; // caption of column
$col[“name”] = “quantity”;
$col[“width”] = “100”;
$col[“sorttype”] = “number”;
$cols[] = $col;
Demo: https://www.phpgrid.org/demo/demos/loading/load-array.php
Code: https://www.phpgrid.org/demo/demos/loading/load-array.phps