Changing Index of Item on Drag/Drop

Currently, I have implemented a model that has nodes with various items in each node. As part of this model, when a user drags an item and drops it, I want to rearrange the item index. I have been able to implement it so that it inserts a copy using diagram.model.insertArrayItem(fields, destinationIndex, fieldData); at the current index and then removes the original using diagram.model.removeArrayItem(fields, sourceIndex);. I was wondering if it is possible to keep the original item and just shuffle its index position using something like diagram.model.moveArrayItem(oldIndex, newIndex)? I know moveArrayItem doesn’t exist but is there some other way to achieve this?

I don’t think so.

If you’re going to do anything more than a simple “move” of an array item, I suggest that you copy the Array, sort it the way that you want, and then assign it back to the node data object.

Okay. Thank you.