I would like to replace a sortable list in a div container by some other element when onUpdate is called. Clearly there is a problem because the list item is still moving when the list has already been replaced. Does anyone know how I can get around this problem? This example causes IE 5.55 and IE 6.0 to throw a javascript error (missing object - I guess in dragdrop.js) Sortable.create( ''list'', { onUpdate: function() { Sortable.destroy(''list''); $(''dest'').update(''no more list - just text!''); // -> IE 5.55 and IE 6.0 -> javascript error } } ) <div id="dest"> <ul id="list"> <li id="item_1">item 1</li> <li id="item_2">item 2</li> </ul> </div> thanks ''boe --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
could try: var someText = document.createTextNode(''no more list - just test!''); $(''dest'').appendChild(someText); On May 24, 4:37 pm, dasboe <bjo...-C/9M+bQ+NTFiszJb17IBaA@public.gmane.org> wrote:> I would like to replace a sortable list in a div container by some > other element when onUpdate is called. Clearly there is a problem > because the list item is still moving when the list has already been > replaced. Does anyone know how I can get around this problem? > > This example causes IE 5.55 and IE 6.0 to throw a javascript error > (missing object - I guess in dragdrop.js) > > Sortable.create( > ''list'', > { > onUpdate: function() { > Sortable.destroy(''list''); > $(''dest'').update(''no more list - just text!''); > // -> IE 5.55 and IE 6.0 -> javascript error > } > } > ) > > <div id="dest"> > <ul id="list"> > <li id="item_1">item 1</li> > <li id="item_2">item 2</li> > </ul> > </div> > > thanks ''boe--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
thanks for the answer but this has a different effect as I intendet because it appends an element to dest. My Problem is more on how to delete the sortable list when onUpdate is called. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
jianfeng008cn-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-May-25 08:49 UTC
Re: replace a sortable list when onUpdate is called
i think you can change the way to get this effect because not everything is impossiable,just like you can whrite a dead whirligig if you like On 5月25日, 上午6时30分, dasboe <bjo...@boesenberg.name> wrote:> thanks for the answer but this has a different effect as I intendet > because it appends an element to dest. My Problem is more on how to > delete the sortable list when onUpdate is called.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
hm - what is a "dead whirligig"? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
jianfeng008cn-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-May-25 09:05 UTC
Re: replace a sortable list when onUpdate is called
:) while(true){ cry(); } On 5月25日, 下午4时57分, dasboe <bjo...@boesenberg.name> wrote:> hm - what is a "dead whirligig"?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
could also add a $(''list'').parentNode.removeChild($(''list'')); to it then? On May 24, 11:30 pm, dasboe <bjo...-C/9M+bQ+NTFiszJb17IBaA@public.gmane.org> wrote:> thanks for the answer but this has a different effect as I intendet > because it appends an element to dest. My Problem is more on how to > delete the sortable list when onUpdate is called.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
tried it and it really works this way - For some reason I thought Element.update() would do the proper removal of child elements for me but I just had a look at the prototype source and it seems not to. - thanks so much!!! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Or $(''list'').remove(); See http://prototypejs.org/api/element/remove best, thomas Am 25.05.2007 um 12:03 schrieb JeDi58:> > could also add a $(''list'').parentNode.removeChild($(''list'')); to it > then? > > On May 24, 11:30 pm, dasboe <bjo...-C/9M+bQ+NTFiszJb17IBaA@public.gmane.org> wrote: >> thanks for the answer but this has a different effect as I intendet >> because it appends an element to dest. My Problem is more on how to >> delete the sortable list when onUpdate is called. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
even better! :) thanks thomas... just to resume my final working code now looks like this: Sortable.create( ''list'', { onUpdate: function() { Sortable.destroy(''list''); $(''list'').remove(); $(''dest'').update(''no more list - just text!''); } } ) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
jianfeng008cn-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-May-28 03:06 UTC
Re: replace a sortable list when onUpdate is called
we use $(''list'') then do something then we can''t use document.getelementbyid(''list'') do something like remove,we must keep the same way because we can see these are two variable share something in javascript On 5月25日, 下午7时29分, dasboe <bjo...@boesenberg.name> wrote:> even better! :) thanks thomas... > > just to resume my final working code now looks like this: > > Sortable.create( > ''list'', > { > onUpdate: function() { > Sortable.destroy(''list''); > $(''list'').remove(); > $(''dest'').update(''no more list - just text!''); > } > } > )--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---