Modify

Opened 13 years ago

Last modified 12 years ago

#8630 new enhancement

Provide an option to not sort the drop down alphabetically

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

Description

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 12 years ago by Chris Bush

Just from playing around with the source code, I was able to disable the alphabetic sorting by modifying web_ui.py. 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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Richard Liao.

Add Comment


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

 
Note: See TracTickets for help on using tickets.