From 3e1d2542445dc4dfb16727414671235362d83411 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 13 Aug 2013 10:03:10 -0400 Subject: [PATCH] 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 --- Open-ILS/xul/staff_client/chrome/content/util/list.js | 8 ++++++++ 1 file changed, 8 insertions(+) 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; -- 2.43.2