Re: [pgAdmin4][Patch]: RM #3029 Cannot sort columns when importing data - Mailing list pgadmin-hackers

From Dave Page
Subject Re: [pgAdmin4][Patch]: RM #3029 Cannot sort columns when importing data
Date
Msg-id CA+OCxozAS+zAUzzb10v4wG_9ZOj_yAOBNYAOQEkExwbNAeLK9A@mail.gmail.com
Whole thread Raw
In response to [pgAdmin4][Patch]: RM #3029 Cannot sort columns when importing data  (Akshay Joshi <akshay.joshi@enterprisedb.com>)
List pgadmin-hackers
Thanks, patch applied.

On Thu, Oct 25, 2018 at 11:58 AM Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi Hackers,

Attached is the patch to fix the RM #3029 Cannot sort columns when importing data.
Select2 orders the selections based on the order of the `<options>` behind the scenes. This means that the order will typically match the order of the options as they appear in the dropdown. For import/export it shows in the order of columns define in the table.

Solution: I have just reorders the options inside the select2 every time, an item is selected. I have made this change into the select2 control with new option "preserveSelectionOrder" by default it is false, so won't impact any other module. 

--
Akshay Joshi
Sr. Software Architect


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

pgadmin-hackers by date:

Previous
From: Dave Page
Date:
Subject: pgAdmin 4 commit: Allow the selection order to be preserved in theSele
Next
From: Dave Page
Date:
Subject: pgAdmin 4 commit: Add support for dropping multiple objects at oncefro