Need hint. Refresh sortable-list after draging element

Hello,

i implemented a dragable list semilar to railcast
147http://railscasts.com/episodes/147-sortable-lists and
it works fine.

Each item of my list has a value wich is accumulated … like this

  • Value A = 3, Sum = 3
  • Value B = 4, Sum = 7
  • Value C = 1, Sum = 8

When i drag Item C on item A i get this

  • Value C = 1, Sum = 8
  • Value A = 3, Sum = 3
  • Value B = 4, Sum = 7

After reload the page it is shown correctly. But i woud like to refresh
only
the list to avoid traffic …
Maybe someone can give me a hint which command or technic i should use.

thanks
Christian

On Sep 23, 2011, at 5:14 AM, HG_Butte wrote:

Value A = 3, Sum = 3
Value B = 4, Sum = 7
After reload the page it is shown correctly. But i woud like to refresh only the
list to avoid traffic …
Maybe someone can give me a hint which command or technic i should use.

I’m a little confused. When you refresh the page, what do you see? The
original order, or the newly sorted order?

If the latter, then there’s no need to refresh the page at all. That’s
the whole point of an Ajax sortable – your page layout is persisted
back to the database, so you don’t have to refresh the page. The new
order is the new DOM order and (after a little back-channel traffic, is
the new database order, too.

If you’re looking for some confirmation that the new order “took”, you
might want to look at the highlight callback.

Walter

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs