On Fri, May 19, 2006 at 10:05:17AM -0600, Tom Gregory wrote:
# The callback definition is your problem:
#     Sortable.create('pathul-' + cg,{onUpdate:function(){reorderPaths 
# (Sortable.serialize('pathul-' + cg))}});
# 
# As you've discovered, it will always call reorder/Serialize on the  
# most recent Sortable--this is because it uses the *current* value of  
# cg, not the value at the time of the onUpdate declaration. The  
# onUpdate option has a parameter, which is equal to the element  
# updated.  Try this:
#     Sortable.create('pathul-' + cg, {onUpdate:function(el) 
# {Sortable.serialize(reorderPaths(el));}});

That worked perfectly. I didn't realize that variable was
late-bound. Thanks for the help!
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to