It take about 1 second locally -- but there is no reason for it to make the round trip. Calling my JS method using oncomplete means that the re-sort doesn't happen until after the roundtrip.
I'm doing a render :nothing on the server. With Mongrel in a production env this would probably be faster -- I just don't want to make the trip for No Reason. Joe -----Original Message----- From: Scott Johnson [mailto:[email protected]] Sent: Friday, November 20, 2009 11:01 AM To: Ruby on Rails: Talk Subject: [Rails] Re: sortable_element helper -- How do I prevent round trip to server? I'm not sure why an asynchronous roundtrip to the server is not quick and light. Even if the server takes a while to respond, the user doesn't have to wait for that response, and in fact shouldn't even realize anything is still pending. On Nov 19, 9:13 pm, Joe <[email protected]> wrote: > I'm using the sortable_element helper method, and for my app I want to > use a javascript snippet update the "position" field without going to > the server and saving the data right away. Other things on the page > could be changing and the re-order needs to be a quick, lite action. > > My the drag-to-sort works fine, and the JS function I call on complete > re-calculates the positions just fine, but even if I don't specify a > value for the URL it still makes the roundtrip to the server. > > How can I prevent this? > > <%= sortable_element :line_items, :tag => 'div', :ghosting => > true, :complete => "sortLineItems()" %> -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=.

