I have a <ul> 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 <li> into the <ul> with Ajax, the sortable_element doesn''t know about it. Is there a way to refresh this collection? Thanks for any help. -- Posted via http://www.ruby-forum.com/.
Julian ''Julik'' Tarkhanov
2006-Jun-26 20:47 UTC
[Rails] Scriptaculous Sortable Element Issue
On 26-jun-2006, at 21:57, guest wrote:> I have a <ul> 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 <li> into the <ul> 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
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 <ul> 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 <li> into the <ul> 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-- Posted via http://www.ruby-forum.com/.
Nevermind. I got it. Thanks a lot! :) Julian ''Julik'' Tarkhanov wrote:> On 26-jun-2006, at 21:57, guest wrote: > >> I have a <ul> 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 <li> into the <ul> 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-- Posted via http://www.ruby-forum.com/.