i know someone just recently asked about queueing ajax requests, my question is similar in the regards that i don't want my application to send multiple requests. i have 2 sortabbles lists left, and right. when i move an item from left to the right the onUpdate callback will send 2 ajax requests. one for each sortables. however. i want it to serialize and send back the results from both lists once.not once each.

lets pretend that my draggable elements in the droppable "left" are 1,2,3 and that the draggables in droppable "right" are 4,5,6

well as it is now, when i drag "left 1" to the bottom of "right" i'd have this serialized

left[]=2&left=3
right[]=4&right[]=5&right[]=6&right[]=1

thats because the onUpdate is called for each sortable. now. is there a way to make it so that the onUpdate is called once but include the information for both droppables, so that in my serialize i'd get this...

left[]=2&left=3&right[]=4&right[]=5&right[]=6&right[]=1

i was thinking if i set up a JS variable that i can set to equal both, then send the data like this

var foo=Sortable.serialize('left')+"&"+Sortable.serialize('right');
new Ajax.Request('some_url', {method:'post', postBody:foo});";
foo="";

how would i do something like that? i need to post both serialized lists to a database in the same field, and it's not efficent to send half the data twice and do an update on the field.

any ideas on how i'd accomplish this task?

thanks
-Jaimz


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

Reply via email to