I want to implement that: move rows in table. Push one button and specified row moves up (or down). First of all, I have the following table: <table id="table"> <tr id="row1"> <td>Test 1</td> <td>Test 2</td> </tr> <tr id="row2"> <td>Test 3</td> <td>Test 4</td> </tr> <tr id="row3"> <td>Test 5</td> <td>Test 6</td> </tr> </table> It''s not a problem to move <row2> to the top or bottom, ''cause I can do: var row2 = $(''row2'').remove(); $(''table'').insert({top: row2}); <or> $(''table'').insert({bottom: row2}); That is. The same with moving <row1> to the bottom or <row3> to the top ;-) But, I want to insert <row1> AFTER <row2>. How to do it? As I Imaging it - first of all, I should remove <row1> from table and this is not a problem (as you can see), and then <insert> it in given position ;-) In any case: why Element.insert are some worth documented? There are also no documentation for {top:} or {bottom:} params. Thank you ;-) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
What about $(''row2'').insert({after: $(''row1'')})? -Fred On Fri, Jun 20, 2008 at 9:35 AM, AlannY <m@alanny.ru> wrote:> > I want to implement that: move rows in table. Push one button and > specified row moves up (or down).-- Science answers questions; philosophy questions answers. --~--~---------~--~----~------------~-------~--~----~ 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 ;-) On Jun 20, 6:59 pm, "Frederick Polgardy" <f...-SMQUYeM9IBBWk0Htik3J/w@public.gmane.org> wrote:> What about $(''row2'').insert({after: $(''row1'')})? > > -Fred > > On Fri, Jun 20, 2008 at 9:35 AM, AlannY <m...-I/IS3f7Pe4GHXe+LvDLADg@public.gmane.org> wrote: > > > I want to implement that: move rows in table. Push one button and > > specified row moves up (or down). > > -- > Science answers questions; philosophy questions answers.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Nice one Frederick, I didn''t know about that one, looking at the documentation though, its a bit sparing, a list of possible positions would do well there. http://www.prototypejs.org/api/element/insert -- Matt Foster Ajax Engineer Nth Penguin, LLC http://www.nthpenguin.com On Jun 20, 11:32 am, AlannY <m...-I/IS3f7Pe4GHXe+LvDLADg@public.gmane.org> wrote:> Thanks ;-) > > On Jun 20, 6:59 pm, "Frederick Polgardy" <f...-SMQUYeM9IBBWk0Htik3J/w@public.gmane.org> wrote: > > > What about $(''row2'').insert({after: $(''row1'')})? > > > -Fred > > > On Fri, Jun 20, 2008 at 9:35 AM, AlannY <m...-I/IS3f7Pe4GHXe+LvDLADg@public.gmane.org> wrote: > > > > I want to implement that: move rows in table. Push one button and > > > specified row moves up (or down). > > > -- > > Science answers questions; philosophy questions answers.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Yeah, I''ve pretty much acclimated to going to the source code when I need an answer to that type of question. :-) I believe you can pass top, bottom, before, and after as keys to the insert hash, and if it''s a plain value (a string, or something with toHTML() or toElement() defined), it''s assumed to be bottom. Top and bottom insert as first child and last child, respectively, while before and after create an immediate sibling above or below. -Fred On Fri, Jun 20, 2008 at 2:36 PM, Matt Foster <mattfoster01-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Nice one Frederick, I didn''t know about that one, looking at the > documentation though, its a bit sparing, a list of possible positions > would do well there. > > http://www.prototypejs.org/api/element/insert-- Science answers questions; philosophy questions answers. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---