I can figure out how to achieve this. Please help.
What needs to happen:
In a repeater, there are several items. These items are connected to a database with a field named 'Position'. The repeater must sort the items by the position from low to high. So when I delete item 3 using remove() by clicking a delete button within the item, the items 4 and 5 in this example, but actually all items higher than 3 must decrease by 1. Because then everything is correct again. 1-2-3-4. Otherwise, it will be 1-2-4-5.
Thanks a lot!
If the position is a value in the collection then you'll have to update the collection. If you can afford having 1-2-4-5 and only wants to show the item index in the repeater, then you remove and refresh the dataset and add something like:
$w.onReady(() => { $w('#repeater1').onItemReady($i, iData, index) => $i('#text1').text = `${iData.title }/Position=${index + 1}`; }) })