[MGNLUI-106] Implement sorting in trees Created: 25/Oct/12  Updated: 10/Sep/15  Resolved: 09/Sep/15

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 5.0
Fix Version/s: None

Type: New Feature Priority: Neutral
Reporter: Andreas Weder Assignee: Unassigned
Resolution: Duplicate Votes: 2
Labels: pain-point, support, tree, ux
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
dependency
duplicate
duplicates MGNLUI-3326 Support sorting by column in trees Closed
relation
is related to MGNLUI-450 Do not sort items in trees alphabetic... Closed
supersession
supersedes MGNLUI-89 Improve List and Tree view (collectin... Closed
is superseded by MGNLUI-3574 Add a sorting popup so that all trees... Closed
Template:
Acceptance criteria:
Empty
Date of First Response:

 Description   

Sorting in trees is not straight forward, since nodes may be arranged manually. In particular, a manual sort order may be used to rearrange items in navigation menus or, in general, to order the page tree in any way a customer may want.

But sorting in trees still makes sense. I've done some research and have devised a way to make this work.
Here's how this could work in the Pages app (other apps work analogously, if they support a manual sort order at all):

  • For every column except the "Page" or first or node column, items are sorted within their hierarchy level only (see below) and depending on the value/column type, i.e. alphabetically, by date and time or (e.g. in case of the "Status" column) in a pre-defined, more semantic sort order.
  • If you sort by "Page" column (or the column representing the actual node), we return to the manual sort order and do not show any sort arrow any more (there's no sort direction there anyway)

Sorting within a single level in the hierarchy is typically how sorting is done in trees.

Details on sorting within a hierarchy level

Sorting in a hierarchy (or tree) sorts all elements on a particular level among themselves and does so on every level. If you e.g. have the following tree, sorted by (node) titles, thus alphabetically, and in ascending order:

 
A
|--A
|  D
B
|--U

..., if you then reverse the sort direction, you'll get:

 
B
|--U
A
|--D
|  A

The mechanics are the same as if you would sort in a list: you simply click in the column header to sort by the attribute represented by that column. Clicking the same header again changes the sort direction.



 Comments   
Comment by Andreas Weder [ 14/Nov/12 ]

Jan approached me and pointed out that users are currently allowed to rearrange items in the page tree. If our tree is always sorted (e.g. alphabetically by page title), we loose this important feature. We thus have to reconsider or redefine this.

I still think we should be able to sort by a specific attribute. A (on first sight: convincing) option I see is that sorting could only affect leaf nodes, but the hierarchy would be left as-is.

Comment by Andreas Weder [ 20/Dec/12 ]

Updated the issue with new insights. This is a tougher job, but worth while the effort.

Comment by Andreas Weder [ 20/Dec/12 ]

Set lower priority as this is more a nice-to-have. I will add a separate issue to ensure that we do NOT sort trees alphabetically.

Comment by Andreas Weder [ 17/Dec/13 ]

I've updated the issue to describe a new function for the tree without referring to a previous, obsolete state. A possibility to sort trees is still relevant and asked for.

Comment by Andreas Weder [ 09/Sep/15 ]

We have two issues covering sorting in trees. I'm closing this in favor of MGNLUI-3326, where most of the discussion took place.

Generated at Mon Feb 12 08:33:39 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.