[pgAdmin][RM4242] Server "Statistics" tab, broken sort

Aditya Toshniwal <[email protected]>
Newsgroups gmane.comp.db.postgresql.pgadmin.devel
Message-ID <CAM9w-_k+YmMsCDq9-Z2bec6C-EcB1eYHh_e6uXy0j9e1Fe3Fcg@mail.gmail.com>
Hi Hackers,

Attached is the patch to fix sorting in backgrid for columns with null
values.
Kindly review.

-- 
Thanks and Regards,
Aditya Toshniwal
Sr. Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"
RM4242.patch (application/octet-stream, 506 B)
diff --git a/web/pgadmin/static/js/backgrid.pgadmin.js b/web/pgadmin/static/js/backgrid.pgadmin.js
index 949c5ee0c..52bcbd9d9 100644
--- a/web/pgadmin/static/js/backgrid.pgadmin.js
+++ b/web/pgadmin/static/js/backgrid.pgadmin.js
@@ -161,6 +161,8 @@ define([
 
           // compare as usual
           if (l === r) return 0;
+          else if (l === null && r != null) return -1;
+          else if (l != null && r === null) return 1;
           else if (l < r) return -1;
           return 1;
         }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.