How to implement item reordering within a grid or custom query

Aware IM supports reordering of items using drag and drop within grids (standard query results) and custom query views (custom query results).

If you want to support item reordering within grids or custom views you need to define a process that would handle the reordering of the items. When the user performs a “drop” she always does it on some node in the grid or custom view. This node always represents some instance of a business object. We will call it the “drop instance”. The node being dragged also represents some instance of the business object. We will call this instance the “drag instance”.

The process implementing the drop must have the object representing drag and drop instances as its input. Both drag and drop instances will be in the Context of the process. The “drop” instance will always be the first in the Context and can be referred to with the “This” prefix. The drag instance will be the second in the Context and can be referred to with the “That” prefix. The rest is up to the process – it can do whatever it wants with the drag and drop instances. For example, if we are reordering a list of tasks and the Task object has the SequenceOrder attribute defining the order of the task in the list we could write our process to do the following:

ThatTask.SequenceOrder = ThisTask.SequenceOrder + 1 

Once you have defined processes to handle item reordering you can start configuring it for those components that need to support it. Go to the “Drag-and-drop/Reordering” property of standard or custom queries, select the “Allow Reordering” radio button and specify the process that handles item reordering.

  • Last modified: 2023/05/09 02:01