Reoder list on RJS response (Script.aculo.us or Prototype me

I’ve got a list of items that I’d like to reorder as part of an RJS
response to an Ajax call to the server. Normally I would just place
the entire list in a div and redraw the list from a partial, but in this
case that’s not a viable option.

It seems to me that this sort of thing should be possible, since the
Script.aculo.us drag&drop is able to re-order lists. However, I’m
having trouble finding the low level Protoype or Script.aculo.us
methods that I can call to do this. I’ve dug through the source of each
as well as the respective API docs, but come up empty handed so far.

It would make me vary happy if all I had to place in my RJS code was
something simple like page.update_position(‘third_list_item’,1) or
page[‘third_list_item’].move_to_top, but I’m realizing now that that’s
probably not possible. If someone with a low level understanding of how
either of these libraries work that can point me in the right direction,
it would be much appreciated.


http://www.5valleys.com/
http://www.workingwithrails.com/person/8078

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