# Sortable Elements

**URL:** <https://www.ruby-forum.com/t/sortable-elements/110627>\
**Category:** Rails\
**Created:** [July 28, 2007, 12:59pm UTC](https://www.ruby-forum.com/t/sortable-elements/110627 "2007-07-28T12:59:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![daborg69](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/d9b06d/32.png) [@daborg69](https://www.ruby-forum.com/u/daborg69)\
**Post date:** [July 28, 2007, 12:59pm UTC](https://www.ruby-forum.com/t/sortable-elements/110627/1 "2007-07-28T12:59:02Z")

</div>

Hello,

I have a page on my website where there is a sortable list (using the  
sortable\_element helper) and also a form which is used to add items the  
sortable list. The sortable list uses the :handle option to setup an  
element to drag each list item by.

The problem is when I submit the form (via AJAX) and update the list  
(using page.insert\_html) I am unable to sort the new item in the list.

I think this is because when the list item is added to the sortable list  
the Event observer isn’t being created for the handle within the list  
item.

If anyone can offer some advise on how to setup an an Event observer in  
rjs to make an item draggable using a handle it would be much  
appreciated.

Scott
