# Scriptaculous Sortable Element Issue

**URL:** <https://www.ruby-forum.com/t/scriptaculous-sortable-element-issue/96156>\
**Category:** Rails\
**Created:** [June 26, 2006, 9:57pm UTC](https://www.ruby-forum.com/t/scriptaculous-sortable-element-issue/96156 "2006-06-26T21:57:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![guest](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8dc957/32.png) [@guest](https://www.ruby-forum.com/u/guest)\
**Post date:** [June 26, 2006, 9:57pm UTC](https://www.ruby-forum.com/t/scriptaculous-sortable-element-issue/96156/1 "2006-06-26T21:57:42Z")

</div>

I have a

 that contains a number of list items, and I’m using the  
sortable\_element helper to reorder then via drag-and-drop. This works  
great, however, when I insert a new - into the 
 with Ajax, the  
sortable\_element doesn’t know about it. Is there a way to refresh this  
collection?

Thanks for any help.

---

<div class="post-metadata">

**Author:** ![guest](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8dc957/32.png) [@guest](https://www.ruby-forum.com/u/guest)\
**Post date:** [June 26, 2006, 10:49pm UTC](https://www.ruby-forum.com/t/scriptaculous-sortable-element-issue/96156/2 "2006-06-26T22:49:59Z")

</div>

On 26-jun-2006, at 21:57, guest wrote:

> I have a
> 
> that contains a number of list items, and I’m using the  
> sortable\_element helper to reorder then via drag-and-drop. This works  
> great, however, when I insert a new - into the 
> with Ajax, the  
> sortable\_element doesn’t know about it. Is there a way to refresh this  
> collection?

Send another Sortable.create command along with your new LI element.

–  
Julian ‘Julik’ Tarkhanov  
please send all personal mail to  
me at julik.nl

---

<div class="post-metadata">

**Author:** ![guest](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8dc957/32.png) [@guest](https://www.ruby-forum.com/u/guest)\
**Post date:** [June 27, 2006, 3:04am UTC](https://www.ruby-forum.com/t/scriptaculous-sortable-element-issue/96156/3 "2006-06-27T03:04:41Z")

</div>

Intersting. Do I “send” it in the controller, or my RJS template?

Thanks

Julian ‘Julik’ Tarkhanov wrote:

> On 26-jun-2006, at 21:57, guest wrote:
> 
> > I have a
> > 
> > that contains a number of list items, and I’m using the  
> > sortable\_element helper to reorder then via drag-and-drop. This works  
> > great, however, when I insert a new - into the 
> > with Ajax, the  
> > sortable\_element doesn’t know about it. Is there a way to refresh this  
> > collection?
> 
> Send another Sortable.create command along with your new LI element.
> 
> –  
> Julian ‘Julik’ Tarkhanov  
> please send all personal mail to  
> me at julik.nl

---

<div class="post-metadata">

**Author:** ![guest](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8dc957/32.png) [@guest](https://www.ruby-forum.com/u/guest)\
**Post date:** [June 27, 2006, 3:31am UTC](https://www.ruby-forum.com/t/scriptaculous-sortable-element-issue/96156/4 "2006-06-27T03:31:38Z")

</div>

Nevermind. I got it. Thanks a lot! 🙂

Julian ‘Julik’ Tarkhanov wrote:

> On 26-jun-2006, at 21:57, guest wrote:
> 
> > I have a
> > 
> > that contains a number of list items, and I’m using the  
> > sortable\_element helper to reorder then via drag-and-drop. This works  
> > great, however, when I insert a new - into the 
> > with Ajax, the  
> > sortable\_element doesn’t know about it. Is there a way to refresh this  
> > collection?
> 
> Send another Sortable.create command along with your new LI element.
> 
> –  
> Julian ‘Julik’ Tarkhanov  
> please send all personal mail to  
> me at julik.nl
