Dynamic Web Development with Seaside

21.6.3Drag and Drop

Drag and Drop list items with jQuery

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 text: 'Save'."
(html submitButton)
callback: [self add];
text: 'Add'].
html render: editor
§
Enhanced ToDo Application
Summary
Callbacks Redux
This is a draft chapter.

Copyright © 19 March 2024 Stéphane Ducasse, Lukas Renggli, C. David Shaffer, Rick Zaccone
This book is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 license.

This book is published using Seaside, Magritte and the Pier book publishing engine.