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

Mircea S. mircea at unom.ro
Fri Feb 13 09:26:20 UTC 2015


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?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside-dev/attachments/20150213/26a6db19/attachment-0001.htm


More information about the seaside-dev mailing list