Opened 5 years ago

Last modified 4 years ago

#8630 new enhancement

Provide an option to not sort the drop down alphabetically

Reported by: sue.sml2006@… Owned by: richard
Priority: normal Component: TracTicketChainedFieldsPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11


Chained fields drop downs are currently sorted alphabetically, but this can result in an uncommon value being shown first, when the designer may wish to have some other more common value be the default.

Attachments (0)

Change History (1)

comment:1 Changed 4 years ago by cjbush77

Just from playing around with the source code, I was able to disable the alphabetic sorting by modifying I removed the line target_options.sort(cmp=lambda x,y: cmp(x.lower(), y.lower())) on line 217 and changed the lines that called to simplejson.loads(tcf_define) to be simplejson.loads(tcf_define, object_pairs_hooks=collections.OrderedDict). I also obviously added an import collections call. This will only work for >Python 2.7. For earlier versions, you have to use the ordereddict library instead of the collections library. I can upload a diff, if that would be helpful.

Add Comment

Modify Ticket

as new The owner will remain richard.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.