Search code examples
javascriptruby-on-railsprototypejsscriptaculous

Moving elements to top/bottom in sortable_element


I'm using sortable_element to sort some list with dragging and dropping, but I would like to have also some top/bottom buttons to move elements. Is there any javascript function that would act as if I dragged some element to the top/bottom of the list?


Solution

  • No, but you easily simulate it with InsertBefore/InsertAfter or other DOM functions.