Thank you Greg for looking at this!
I tried it with the JS on ready but always get the same error: cannot find children of 'null'.
The widget had already been placed inside a container. The container has been given the data-id attribute. This by itself does not work. However, if I add "div" to the ChildElementSelector it works. The problem here is that the events are not triggered. So the Sortable object is made and I can sort the items, but the events are not triggered so nothing happens on choose, unchoose, update, end...

It also works if I set the data-id attribute on the image inside the widget and set "img" as ChildElementSelector. However, here too are none of the events triggered.
For now I have added a button to save the new order but I will keep looking for a workaround for this so that it saves after every sort action.
Thank you for taking a look at this, much appreciated!
Liesbeth