Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-106

Implement sorting in trees

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Duplicate
    • Icon: Neutral Neutral
    • None
    • 5.0
    • None

      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.

        Acceptance criteria

              Unassigned Unassigned
              weder Andreas Weder
              Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: