I made this as simple as I could. I get an array of empty strings sequence. The alert comes up ''''. Is just me? I can''t get setSequence to work either it clears my ul. This is with 1.6.5 and 1.7.0 beta 2. In the Firefox debugger it shows an arrary of three items returned, but the items are three empty strings. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script src="javascript/prototype.js" type="text/javascript"></script> <script src="javascript/scriptaculous.js" type="text/javascript"></script> </head> <body> <ul id="list1" > <li id="item1" >Item 1</li> <li id="item2" >Item 2</li> <li id="item3" >Item 3</li> </ul> <script type="text/javascript"> // <![CDATA[ Sortable.create(''list1''); function sortList(){ var seq = Sortable.sequence(''list1''); alert(seq); } // ]]> </script> <input value="ClickMe" onClick="sortList()" type="button"/> </body> </html> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jackson Thompson
2007-Jan-10 20:24 UTC
Sortable.sequence returning an arrray of empty elements.
I made this as simple as I could. I get an array of empty strings sequence. The alert comes up ''''. Is just me? I can''t get setSequence to work either it clears my ul. This is with 1.6.5 and 1.7.0 beta 2. In the Firefox debugger it shows an arrary of three items returned, but the items are three empty strings. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script src="javascript/prototype.js" type="text/javascript"></script> <script src="javascript/scriptaculous.js" type="text/javascript"></script> </head> <body> <ul id="list1" > <li id="item1" >Item 1</li> <li id="item2" >Item 2</li> <li id="item3" >Item 3</li> </ul> <script type="text/javascript"> // <![CDATA[ Sortable.create(''list1''); function sortList(){ var seq = Sortable.sequence(''list1''); alert(seq); } // ]]> </script> <input value="ClickMe" onClick="sortList()" type="button"/> </body> </html> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Tom Gregory
2007-Jan-10 22:23 UTC
Re: Sortable.sequence returning an arrray of empty elements.
Try your ids as ''item_1'', ''item_2'', etc. The sequence code uses a regexp (as defined in options.format) and expects an underscore. If for some reason you don''t want to use the underscore, change the ''format'' in options. You can try: {format: /(\d+)$/} // returns 1,2,3 Or: {format: /^(.*)$/} // returns item1, item2, item3 To use the format option, your Sortable.create line would become: Sortable.create(''list1'', {format: /^(.*)$/}); TAG On Jan 10, 2007, at 1:24 PM, Jackson Thompson wrote:> > I made this as simple as I could. I get an array of empty strings > sequence. The alert comes up ''''. Is just me? I can''t get setSequence > to work either it clears my ul. This is with 1.6.5 and 1.7.0 beta 2. > In the Firefox debugger it shows an arrary of three items returned, > but > the items are three empty strings. > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> > <html> > <head> > <meta http-equiv="Content-Type" content="text/html; > charset=iso-8859-1"> > <script src="javascript/prototype.js" type="text/javascript"></script> > <script src="javascript/scriptaculous.js" > type="text/javascript"></script> > </head> > <body> > <ul id="list1" > > <li id="item1" >Item 1</li> > <li id="item2" >Item 2</li> > <li id="item3" >Item 3</li> > </ul> > <script type="text/javascript"> > // <![CDATA[ > > Sortable.create(''list1''); > > function sortList(){ > var seq = Sortable.sequence(''list1''); > alert(seq); > } > > // ]]> > </script> > > <input value="ClickMe" onClick="sortList()" type="button"/> > </body> > </html> > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thank you, the underscore did the trick. On Jan 10, 4:23 pm, Tom Gregory <t...-PGZyUNKar/Q@public.gmane.org> wrote:> Try your ids as ''item_1'', ''item_2'', etc. > > The sequence code uses a regexp (as defined in options.format) and > expects an underscore. > > If for some reason you don''t want to use the underscore, change the > ''format'' in options. > > You can try: > {format: /(\d+)$/} // returns 1,2,3 > Or: > {format: /^(.*)$/} // returns item1, item2, item3 > > To use the format option, your Sortable.create line would become: > Sortable.create(''list1'', {format: /^(.*)$/}); > > TAG--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---