Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQXBV-0003dO-2K for pgadmin-hackers@arkaria.postgresql.org; Mon, 09 Jan 2017 10:28:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cQXBU-0003BG-FJ for pgadmin-hackers@arkaria.postgresql.org; Mon, 09 Jan 2017 10:28:12 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cQXBT-0003B8-Vl for pgadmin-hackers@postgresql.org; Mon, 09 Jan 2017 10:28:12 +0000 Received: from mail-io0-x234.google.com ([2607:f8b0:4001:c06::234]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cQXBQ-0005eD-K0 for pgadmin-hackers@postgresql.org; Mon, 09 Jan 2017 10:28:10 +0000 Received: by mail-io0-x234.google.com with SMTP id v96so76873100ioi.0 for ; Mon, 09 Jan 2017 02:28:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgadmin-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=yPQeim9LNSZjlpjFfPIwpU9uW42zamQ7dJQjGb5bf38=; b=FAf+2/bSb/1YhlZVf/KIZxZ7ewJsteh4Lu91p458qanyMqEJntOkYGkRqJHZqa7gOi qaNUQclDOJiOD/sx07CwullOZbKalKI0rrESqnasT440APbOoRxhGlqUw9+Y6wFPPszu S9w3ZcqqzE8gE+gMonChWrkY8JBw8BikZ7ILnAzg8v6bOxR8eB2Obckpe7R8iduKNnLs 9SNOrfJcfVXmOTfUGb1e84TnL1pnF4kbo/JRz9zsB0JHJsLs1WjEuGcmk87p3P0lypFD Ajz3Z0I8PDDeP3mDioy8WPvs/LxW5wYdEKY3FZ4axrOy9j91fj58+mHxnQCwWhtmbjFz qQMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=yPQeim9LNSZjlpjFfPIwpU9uW42zamQ7dJQjGb5bf38=; b=Hs8HCws/Yv0/P/cwloVp1Ze4Ix0ETT33d9cO6IIf08OljUNw+lCiiJfe0V98zfuAkS OF2J6gCkdSNehON6ItiR2HyglwOn9alcoOV9iU6ka424n1F/HMRxMnj8fUBEzwEokSFy e90km825+8MQ5OtxDCxOA5EUiSfQg25uPuAKEh5vrp6xQ9BMZQcYFkLKAHLul4wEoHx0 5atL13FTsLfoep4ob+TFdLyffGuvD+6pXO4ZTmHEJ1e/QN2PvILEOKWaNvyEZQEgQSqz PBsxVF1AS6R4YONJRRBbvVdTgO3Fpu5u8+gwwwhL7iN4cdFhdUqLH7++STI8uAdc8zKz Dw3Q== X-Gm-Message-State: AIkVDXIj8hL7eywynggpp6qtf3v/J3+o3C26m7rxokiFhIDiJ3Ew05jsdwbuTuhEv70knlOYXsbh9a8eIUJPdw== X-Received: by 10.107.11.27 with SMTP id v27mr16931548ioi.145.1483957687857; Mon, 09 Jan 2017 02:28:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.64.224.198 with HTTP; Mon, 9 Jan 2017 02:28:07 -0800 (PST) In-Reply-To: References: From: Dave Page Date: Mon, 9 Jan 2017 15:58:07 +0530 Message-ID: Subject: Re: [pgAdmin4][Patch]: RM1938 - Backgrid sorting not working for Integer/Number types To: Surinder Kumar Cc: pgadmin-hackers Content-Type: text/plain; charset=UTF-8 X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org Thanks - that works nicely, so patch applied. On Mon, Jan 9, 2017 at 3:42 PM, Surinder Kumar wrote: > Hi Dave, > > I just missed the code for swapping left and right values if order is > descending. It's fixed. > Please find attached patch and review. > > On Mon, Jan 9, 2017 at 9:05 AM, Dave Page wrote: >> >> Hi >> >> On Friday, January 6, 2017, Surinder Kumar >> wrote: >>> >>> Hi, >>> >>> As the type of data we get from server side is of string type, due to >>> which the sorting for Integer/Number type columns is not working. >>> >>> To fix this issue, we are using BigNumber JS library. >>> We are overriding Backgrid's sort and make_comparator method in >>> backgrid.pgadmin.js. >>> >>> When sorting is performed based on column we identify the column >>> type(integer/number) and then convert its value into BigInteger and the >>> sorts data. >>> >>> This patch is dependent on patch sent for "Adding support for BigNumber >>> JS library". >>> >>> Also, thanks to Murtuza for help. >>> >>> Please find attached patch and review. >> >> >> This works fine for ascending sorts, but if i click the row header a >> second time for a descending sort, the order isn't reversed as expected. >> >> Thanks, Dave. >> >> >> -- >> Dave Page >> Blog: http://pgsnake.blogspot.com >> Twitter: @pgsnake >> >> EnterpriseDB UK: http://www.enterprisedb.com >> The Enterprise PostgreSQL Company >> > -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers