Change order using Drag & Drop

Is it possible to use Drag & Drop to change the order of elements in a list?

This is on the roadmap!

Until supported - here you have a (not too nice) workaround (might possibly also be solved with a coded component):

Assuming you have a list of Tasks. Each task is given a new property “Sort order” (integer), and Tasks (the data) are updated initially so that the Tasks have sort orders 1, 2, 3, etc (unique values).

A new object class “Sort order” with a property “Sort order” (int). This object class is added as a runtime-only Datasource (Many) and is populated with e.g. 100 objects after app load (or an equal amount of objects as there are tasks).

You repeat the “Sort order” data source instead of the Tasks data source. Inside each “Sort order”, you repeat “Tasks” filtered with “Task.Sort order Equals Sort order.Sort order”. That would leave 1 task inside each “Sort order container”.

The single Sort Order Container is Droppable. The Activity Container is draggable.

The On Drop action on the Sort Order Container: update task (object in context), set Task.Sort Order to Sort Order (in context).Sort order.

That would put the Task inside the correct sort order container. But in addition, you will need to update the Sort orders of the Tasks between where you moved the Task from/to by +1 or -1 (depending on dragging up or down).

Any updates on this?

Hi!

Sorry, no, it is still on the roadmap. This is a new platform concept, with dependencies towards other new concepts that need to come first (multicardinality properties, just launched under feature flag). So unfortunately we cannot give a date for this one yet. But it is still up there on the list!