what about just re-creating the sortables on update?
... onUpdate: function(sortContainer){
Sortable.create(...);
Sortable.create(...);
}
The sortables first get destroy (including the draggables) and then
re-created
hth
sigi
2006/2/1, Peter Michaux
<petermichaux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:>
> Hi,
>
> I have two sortables with different options (but same tags. just
> ''li''). When I drag an item from sortable1 to sortable2 I
want it to
> gain the options that the sortable2 items have.
>
> I''ve tried all day to understand how Draggables and their
observers
> are destroyed but I keep gettting buggy behavior. Part of the problem
> is the draggable and the draggableObserver are different. So
> confusing! Droppables.add and Droppables.remove seem to work well.
> Where is Draggables.add and Draggables.remove when I need them?
>
> My idea is to use the onUpdate option of Sortables to call a function
> that will delete and then recreate all of the draggables and
> droppables with all the same options. My function and it''s various
> attempt statements is below. Any ideas?
>
> Thanks,
> Peter
>
> function homogenize(element, options){
> element=$(element);
>
> Sortable.findElements($(element), options).each(function(k){
>
> Draggables.removeObserver($(k));
> Draggables.unregister($(k));
> Draggables.deactivate(k);
>
> new Draggable(k,options);
>
> Droppables.remove($(k));
> Droppables.add(k, options);
> });
> } // homogenize
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>
--
Mit freundlichen Grüßen
Siegfried Puchbauer
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs