Sortable List with Ajax

Sortable List with Ajax

  
Here's a small sample on how to order a list using the new Container Widget in the OutSystems Platform 4.0. The sorting is made by dragging the elements up and down and releasing them on the desired position.

The sample uses Javascript code from script.aculo.us and makes use of Ajax callbacks to sort the elements in the database.

Things to look for when customizing this sample:
- The Container Widget around the List Record has a name. The ID of this widget is used in the script that creates the list.
- The Container Widget inside the List Record must have a name (any name) and an extended property called "ItemId" with value set to the ID of the current list item (check the "DivSort" screen Javascript to see how this is used).
- The Preparation in the "OrderList" screen does all the database work.
- The "ShowDatabase" screen is for demo purposes only. Feel free to delete it.

Cheers,
Rodrigo