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
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs