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

**URL:** <https://www.ruby-forum.com/t/reoder-list-on-rjs-response-script-aculo-us-or-prototype-me/115020>\
**Category:** Rails\
**Created:** [September 19, 2007, 8:15pm UTC](https://www.ruby-forum.com/t/reoder-list-on-rjs-response-script-aculo-us-or-prototype-me/115020 "2007-09-19T20:15:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonlog](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/db5fbb/32.png) [@jonlog](https://www.ruby-forum.com/u/jonlog)\
**Post date:** [September 19, 2007, 8:15pm UTC](https://www.ruby-forum.com/t/reoder-list-on-rjs-response-script-aculo-us-or-prototype-me/115020/1 "2007-09-19T20:15:49Z")

</div>

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](http://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](http://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.5valleys.com/)  
[http://www.workingwithrails.com/person/8078](http://www.workingwithrails.com/person/8078)
