[Seaside] Re: Sortable refresh?

Stephan Eggermont stephan at stack.nl
Wed Apr 14 13:00:56 UTC 2010

Thank you Lukas,

Using the following code, I've managed to get card sorting working.
The card borders change color depending on the column they are in.
I noticed the script: tag had to be last?

Might be useful in the GSoC process...

renderColumn: aColumn on: canvas
	| id |
	id := canvas nextId.
	even := even not.
	canvas div
		class: 'column';
		with: [
			canvas heading: (aColumn title).
			canvas unorderedList
				class: 'sortable ', even asString;
				id: id;
				script: (canvas jQuery new sortable
					connectWith: '.sortable';
					dropOnEmpty: true;
					onUpdate: (canvas jQuery ajax
						callback: [ :values | aColumn setItems: values]
						passengers: (canvas jQuery this find: 'li');
						script: [ :s |
							s add: ((s jQuery: '#',id )
							html: [:h |
								self renderListItems: (aColumn items) on: h])]));
				with: [self renderListItems: (aColumn items) on: canvas]]

The resulting demo looks like this:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Cards.png
Type: image/png
Size: 52703 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/seaside/attachments/20100414/a1fd9b55/Cards-0001.png
-------------- next part --------------

More information about the seaside mailing list