public inbox for [email protected]  
help / color / mirror / Atom feed
From: Aditya Toshniwal <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin][RM4242] Server "Statistics" tab, broken sort
Date: Thu, 31 Oct 2019 16:57:30 +0530
Message-ID: <CAM9w-_k+YmMsCDq9-Z2bec6C-EcB1eYHh_e6uXy0j9e1Fe3Fcg@mail.gmail.com> (raw)

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"


Attachments:

  [application/octet-stream] RM4242.patch (506B, 3-RM4242.patch)
  download | inline diff:
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;
         }


view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: [pgAdmin][RM4242] Server "Statistics" tab, broken sort
  In-Reply-To: <CAM9w-_k+YmMsCDq9-Z2bec6C-EcB1eYHh_e6uXy0j9e1Fe3Fcg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox