Edgewall Software

Opened 16 years ago

Last modified 7 years ago

#7026 new enhancement

[Patch] Query module column reordering — at Version 2

Reported by: ebray Owned by: Matthew Good
Priority: normal Milestone: next-major-releases
Component: report system Version: devel
Severity: normal Keywords: patch
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Christian Boos)

This is a patch I came up with at PyCon specifically because some of my users need it, but I think something like it could go into Trac core.

First of all it solves the problem of the poor scalability of the UI for selecting columns to display, which is pretty unusable in situations where there are something on the order of 50 custom fields (which I've seen, and it's ugly).

I also needed the ability to let users reorder the columns, which this solves. I'm not sure how the Trac devs will feel about this. It replaces the 'col=' query arguments with arguments in the form 'col#=', where # is the order that that column should be displayed in. This works fine for URL query strings. But I haven't updated the TracQuery syntax to support column reordering. Other than that it seems to work fine, and includes support for non-JavaScript users.

Change History (3)

by hyugaricdeau@…, 16 years ago

Some of the diffs may be from my editor removing stray whitespace, which may be annoying.

comment:1 by hyugaricdeau@…, 16 years ago

Component: generalreport system
Owner: changed from Jonas Borgström to Matthew Good
Type: defectenhancement
Version: devel

Forgot to set all the other fields, oops.

comment:2 by Christian Boos, 16 years ago

Description: modified (diff)
Milestone: 0.12
Priority: normalhigh

I tried the patch and it works great. I think the UI is perfect for the non JavaScript case, but with JavaScript enabled, I'm sure we could even make this more intuitive in the future by providing the possibility to simply dragg the column name up and down.

I'm not sure about passing the ordering info (coln). Currently, we simply rely on the order of the col arguments in req.args['col'] to be the same as they appear in the query string. Is there a situation were this wouldn't work? If not, I think the code could be simplified a lot. At the very least, the col parameters without a number should still be supported for backward compatibility and for example, added at the end after the numbered columns.

Note: See TracTickets for help on using tickets.