Login  Register

Seaside jQuery - Sorting a list with drag and drop and sending it back via Ajax causes OrderedCollection to turn into an Array?

Posted by basilmir on Feb 13, 2015; 9:20am
URL: https://forum.world.st/Seaside-jQuery-Sorting-a-list-with-drag-and-drop-and-sending-it-back-via-Ajax-causes-OrderedCollecti-tp4805446.html

The code below is form the Seaside book at: http://book.seaside.st/book/web-20/jquery/enhanced-todo-application/drag-and-drop


ToDoListView>>renderContentOn: html

self renderHeadingOn: html.
     html form: [(html unorderedList)
                                    id: (listId := html nextId);
                                    script: ((html jQuery new sortable)
                                                            onStop: (html jQuery ajax
                                                            callback: [:items | self model items: items]
                                                            passengers: (html jQuery this find: 'li'));
                                                            axis: 'y');
                                   with: [self renderItemsOn: html].
                       
                       (html submitButton)
                                callback: [self add];
                                text: 'Add'].
html render: editor

My instance variable _itemList is initially OrderedCollection. As soon as I move the rows around in the page then entire list is sent back in it's new order. However, this time setItemList: receives an Array.

Does this make any sense? Am I missing something?