Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-26523

Sorting in Object Relation List field

    XMLWordPrintable

Details

    Description

      The Object Relations -field is often used for selecting items to be displayed in specific order. In the eZ Platform UI there is no guarantee of in which order items are loaded and there is no interface to order items. However, in the backend the priority is stored.

      There is two parts in adding sorting capability to the fieldtype UI:

      • Loading relations in specific order
      • Allowing sorting of elements by user

      Loading relations in specific order

      Currently ez-objectrelationsloadplugin.js loads the object using YUI Parallel functionality and pushes them into array as they are returned from the front end. Order of this is completely random and not guaranteed.

      The parameter contentDestinations is available and has the correct ordering from the database. This should be used to sort the array containing the asynchronously loaded "randomly sorted" items before returning them.

      Allowing sorting of elements by user

      The editing interface for the field type (in ez-relationlist-editview.js) uses the above loader to load items. If the sorting is fixed, then the starting point is good to add sorting capability.

      The YUI Sortable can be used to make the table containing the items to be sortable by the user with drag and drop (https://www.youtube.com/watch?v=eYcCWfCTQbk).

      In addition to the UI, the attribute containing the list of object IDs sent to the backend must be correct as well.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jani.tarvainen@ibexa.co Jani Tarvainen
            Votes:
            7 Vote for this issue
            Watchers:
            12 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: