Reorder accordion cells with code

For 6.4 PRO version accordion. Is there a way /workaround to reorder accordion cells through code. I see that we can Drag and drop manually/ move to top with api moveOnTop()

How to move to a particular position(through code without drag and drop). Any workaround?

One of the issues that I am facing is that when a user drags the accordion cells up and down, and I use the iterator
myAcc.forEachItem(function(cell){
// cell => myAcc.cells(id)

});

it does not iterate in the new order /index. Therefore I’m having trouble finding the index to which the cell has moved. Any help highly appreciated.

any workaround guys please? I see the Tabbar and other components seems to have options to move the tabs to index but accordion does not ? :confused:
If there is some workaround to move it to a particular index atleast that will be great help(I have around 40 cells in some cases and drag and drop is quite a pain for the users)

Hello.

Unfortunately as You’ve mentioned, there are no indexes for the accordion cells. Only the ids are available. The only solution is to assign the accordion ids to your object with some kind of indexes to preserve the cells order.