Tristan Kelley wrote:
I'm having trouble using Insertion.After with a sortable list. The new item is inserted properly but is not sortable because it's not in the document flow (at least I assume that's the trouble). Any ideas on getting around this? Thanks.

The new items is probably not sortable because when the sortable list is created all elements get setup as a draggable element. Your new element does not get that draggable initialization.

I would guess that you could just re-run the same code you used to make it a sortable in the first place although maybe that would cause problems since two sets of event handlers will be attached.

The less brute force approach is to just initialize your new element as a draggable just like the Sortables does.

You'll probably just have to play with it a bit. Would be nice if the Sortables had a "reinit" method that would reinitialize a list while at the same time cleaning up the event handlers from the old initialization.

Eric

_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to