From: Bill Erickson Date: Tue, 13 Aug 2013 14:03:10 +0000 (-0400) Subject: LP1211506 fix numeric sorting in staff client grids X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3e1d2542445dc4dfb16727414671235362d83411;p=evergreen%2Fequinox.git LP1211506 fix numeric sorting in staff client grids To recover numeric (vs. ascii-betical) sorting of number and money values in grids, cast the cached sort values back into numbers. This was tested in the billing interface, but should repair numeric sorting for most grids. Signed-off-by: Bill Erickson Signed-off-by: Jason Etheridge Signed-off-by: Ben Shum --- diff --git a/Open-ILS/xul/staff_client/chrome/content/util/list.js b/Open-ILS/xul/staff_client/chrome/content/util/list.js index 1ddfb0f0a3..d4e5039b08 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/list.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/list.js @@ -1784,6 +1784,14 @@ util.list.prototype = { if (a.sort_value) { a = a.sort_value; b = b.sort_value; + + // ensure that numeric values have not + // morphed into strings along the way. + if (obj.columns[p].sort_type == 'money' || + obj.columns[p].sort_type == 'number') { + a = Number(a); + b = Number(b); + } } else { a = a.value; b = b.value;