Up/Down buttons in Composition table

Hi Konstantin Krivopustov,
In example: https://github.com/knstvk/cuba-sample-sort-composition.
I want to make MoveUp/MoveDown buttons to move record’s position in “ordersTable” . please help me how to do it!

Hi,

You can do it in the same way as it is done in OrderEdit.java: determine the index of the currently selected item and then swap the items using collectionContainer.getMutableItems().set(idx, item).

BTW, the master branch of the example is upgraded to CUBA 7. The old code is now in the cuba-6 branch.