I have no problems getting Sortables to work on content written into
the html files but it never seems to work if the list is added via
javascript. Is there something I''m doing wrong? Here are the pertinent
parts of my code:
html portion:
<div id="contents"></div>
javascript portion:
document.getElementById("contents").innerHTML=''<ul
id="lists"><li>blah</li></ul>'' +
''<script type="text/javascript">'' +
'' Sortable.create(''lists'',{ghosting:true})''
+
''</script>'';
The list shows up but it''s not draggable.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Probably the script tag is not getting executed. As you''re in
JavaScript anyway try something like this:
document.getElementById("contents").innerHTML=''<ul
id="lists"><li>blah</li></ul>'';
Sortable.create(''lists'',{ghosting:true});
or a Prototype way
$("contents").update(''<ul
id="lists"><li>blah</li></ul>'');
Sortable.create(''lists'',{ghosting:true});
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
> document.getElementById("contents").innerHTML=''<ul > id="lists"><li>blah</li></ul>''; > Sortable.create(''lists'',{ghosting:true});in hindsight, that was an incredibly obvious solution. can''t believe I missed that. ^^;; thanks! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---