Sam
2007-Oct-01 08:29 UTC
How to make a list with columns and a header row sortable through drag-and-drop
New to scriptaculous and just recently got started in web app programming too. What I would really like to have is a sortable table using Sortable.create and tr as tag. I''ve noticed other people on the list asking for the same thing but no real answers have shown up that I could find. The page for Sortable.create however, says that due to some technical limitation it''s not possible to create a sortable from a table. But a user comment on the page mentioned you could use tbody and tr. So I tried that and while I was able to sort the rows then, I did not get a floating row that follows the mouse cursor as the sortable lists example does. So I was wondering if there was maybe some workaround. What I want is a sortable collection of rows that contain an amount of subelements that I would like to be aligned with a row of header columns. I was wondering if it might be possible to do it with an unordered list where each column value would be in a span or something that would have a class corresponding to the right column? Do you think that would work? And would it be ok to use span like that? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Diodeus
2007-Oct-01 12:56 UTC
Re: How to make a list with columns and a header row sortable through drag-and-drop
Use <li> elements and style them to look like a table. Tables don''t play well. On Oct 1, 4:29 am, Sam <sgron...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> New to scriptaculous and just recently got started in web app > programming too. > > What I would really like to have is a sortable table using > Sortable.create and tr as tag. I''ve noticed other people on the list > asking for the same thing but no real answers have shown up that I > could find. The page for Sortable.create however, says that due to > some technical limitation it''s not possible to create a sortable from > a table. But a user comment on the page mentioned you could use tbody > and tr. So I tried that and while I was able to sort the rows then, I > did not get a floating row that follows the mouse cursor as the > sortable lists example does. > > So I was wondering if there was maybe some workaround. What I want is > a sortable collection of rows that contain an amount of subelements > that I would like to be aligned with a row of header columns. I was > wondering if it might be possible to do it with an unordered list > where each column value would be in a span or something that would > have a class corresponding to the right column? Do you think that > would work? And would it be ok to use span like that?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Gareth Evans
2007-Oct-01 19:55 UTC
Re: How to make a list with columns and a header row sortable through drag-and-drop
If using li elements, is there a ''best way'' to handle columns? Gareth On 10/2/07, Diodeus <diodeus-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Use <li> elements and style them to look like a table. Tables don''t > play well. > > On Oct 1, 4:29 am, Sam <sgron...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > New to scriptaculous and just recently got started in web app > > programming too. > > > > What I would really like to have is a sortable table using > > Sortable.create and tr as tag. I''ve noticed other people on the list > > asking for the same thing but no real answers have shown up that I > > could find. The page for Sortable.create however, says that due to > > some technical limitation it''s not possible to create a sortable from > > a table. But a user comment on the page mentioned you could use tbody > > and tr. So I tried that and while I was able to sort the rows then, I > > did not get a floating row that follows the mouse cursor as the > > sortable lists example does. > > > > So I was wondering if there was maybe some workaround. What I want is > > a sortable collection of rows that contain an amount of subelements > > that I would like to be aligned with a row of header columns. I was > > wondering if it might be possible to do it with an unordered list > > where each column value would be in a span or something that would > > have a class corresponding to the right column? Do you think that > > would work? And would it be ok to use span like that? > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Diodeus
2007-Oct-01 20:12 UTC
Re: How to make a list with columns and a header row sortable through drag-and-drop
Put the columns in DIVs, float:left with fixed width inside the <li> On Oct 1, 3:55 pm, "Gareth Evans" <agr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> If using li elements, is there a ''best way'' to handle columns? > > Gareth > > On 10/2/07, Diodeus <diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Use <li> elements and style them to look like a table. Tables don''t > > play well. > > > On Oct 1, 4:29 am, Sam <sgron...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > New to scriptaculous and just recently got started in web app > > > programming too. > > > > What I would really like to have is a sortable table using > > > Sortable.create and tr as tag. I''ve noticed other people on the list > > > asking for the same thing but no real answers have shown up that I > > > could find. The page for Sortable.create however, says that due to > > > some technical limitation it''s not possible to create a sortable from > > > a table. But a user comment on the page mentioned you could use tbody > > > and tr. So I tried that and while I was able to sort the rows then, I > > > did not get a floating row that follows the mouse cursor as the > > > sortable lists example does. > > > > So I was wondering if there was maybe some workaround. What I want is > > > a sortable collection of rows that contain an amount of subelements > > > that I would like to be aligned with a row of header columns. I was > > > wondering if it might be possible to do it with an unordered list > > > where each column value would be in a span or something that would > > > have a class corresponding to the right column? Do you think that > > > would work? And would it be ok to use span like that?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Gareth Evans
2007-Oct-01 20:17 UTC
Re: How to make a list with columns and a header row sortable through drag-and-drop
Thats what I thought, it works except when you want the width to be automatically allocated like a normal table would - and then you have to do calculations on the server side (or client if you prefer) to provide a width %/px based on the width of the table and the number of columns (lets say for this example you dont actually know exactly how many columns, every entity (company/contact/employee etc) has different numbers displayed. I''m not trying to pick holes in the model, far from it, just trying to hint at tables being useful for, well, tabular data. What''s the technical reason they can''t be sorted anyway? Gareth On 10/2/07, Diodeus <diodeus-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Put the columns in DIVs, float:left with fixed width inside the <li> > > On Oct 1, 3:55 pm, "Gareth Evans" <agr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > If using li elements, is there a ''best way'' to handle columns? > > > > Gareth > > > > On 10/2/07, Diodeus <diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > Use <li> elements and style them to look like a table. Tables don''t > > > play well. > > > > > On Oct 1, 4:29 am, Sam <sgron...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > New to scriptaculous and just recently got started in web app > > > > programming too. > > > > > > What I would really like to have is a sortable table using > > > > Sortable.create and tr as tag. I''ve noticed other people on the list > > > > asking for the same thing but no real answers have shown up that I > > > > could find. The page for Sortable.create however, says that due to > > > > some technical limitation it''s not possible to create a sortable > from > > > > a table. But a user comment on the page mentioned you could use > tbody > > > > and tr. So I tried that and while I was able to sort the rows then, > I > > > > did not get a floating row that follows the mouse cursor as the > > > > sortable lists example does. > > > > > > So I was wondering if there was maybe some workaround. What I want > is > > > > a sortable collection of rows that contain an amount of subelements > > > > that I would like to be aligned with a row of header columns. I was > > > > wondering if it might be possible to do it with an unordered list > > > > where each column value would be in a span or something that would > > > > have a class corresponding to the right column? Do you think that > > > > would work? And would it be ok to use span like that? > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Markus Hammer
2007-Oct-02 08:10 UTC
Re: How to make a list with columns and a header row sortable through drag-and-drop
why do table rows not play well with sortable? not that i love tables, but when it comes to tabular data, why shouldnt you use tables... On 1 Okt., 22:17, "Gareth Evans" <agr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thats what I thought, it works except when you want the width to be > automatically allocated like a normal table would - and then you have to do > calculations on the server side (or client if you prefer) to provide a width > %/px based on the width of the table and the number of columns (lets say for > this example you dont actually know exactly how many columns, every entity > (company/contact/employee etc) has different numbers displayed. > > I''m not trying to pick holes in the model, far from it, just trying to hint > at tables being useful for, well, tabular data. > > What''s the technical reason they can''t be sorted anyway? > > Gareth > > On 10/2/07, Diodeus <diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Put the columns in DIVs, float:left with fixed width inside the <li> > > > On Oct 1, 3:55 pm, "Gareth Evans" <agr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > If using li elements, is there a ''best way'' to handle columns? > > > > Gareth > > > > On 10/2/07, Diodeus <diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Use <li> elements and style them to look like a table. Tables don''t > > > > play well. > > > > > On Oct 1, 4:29 am, Sam <sgron...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > New to scriptaculous and just recently got started in web app > > > > > programming too. > > > > > > What I would really like to have is a sortable table using > > > > > Sortable.create and tr as tag. I''ve noticed other people on the list > > > > > asking for the same thing but no real answers have shown up that I > > > > > could find. The page for Sortable.create however, says that due to > > > > > some technical limitation it''s not possible to create a sortable > > from > > > > > a table. But a user comment on the page mentioned you could use > > tbody > > > > > and tr. So I tried that and while I was able to sort the rows then, > > I > > > > > did not get a floating row that follows the mouse cursor as the > > > > > sortable lists example does. > > > > > > So I was wondering if there was maybe some workaround. What I want > > is > > > > > a sortable collection of rows that contain an amount of subelements > > > > > that I would like to be aligned with a row of header columns. I was > > > > > wondering if it might be possible to do it with an unordered list > > > > > where each column value would be in a span or something that would > > > > > have a class corresponding to the right column? Do you think that > > > > > would work? And would it be ok to use span like that?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Diodeus
2007-Oct-02 13:07 UTC
Re: How to make a list with columns and a header row sortable through drag-and-drop
Tables need to be manipulated at a DOM node level, whereas <LI> can easily be rearranged in the HTML. See: http://developer.mozilla.org/en/docs/Traversing_an_HTML_table_with_JavaScript_and_DOM_Interfaces Not that I''m against tables, it''s just I don''t think the drag/drop script was written to manipulate tables. On Oct 2, 4:10 am, Markus Hammer <yaya...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> why do table rows not play well with sortable? > not that i love tables, but when it comes to tabular data, why > shouldnt you use tables... > > On 1 Okt., 22:17, "Gareth Evans" <agr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Thats what I thought, it works except when you want the width to be > > automatically allocated like a normal table would - and then you have to do > > calculations on the server side (or client if you prefer) to provide a width > > %/px based on the width of the table and the number of columns (lets say for > > this example you dont actually know exactly how many columns, every entity > > (company/contact/employee etc) has different numbers displayed. > > > I''m not trying to pick holes in the model, far from it, just trying to hint > > at tables being useful for, well, tabular data. > > > What''s the technical reason they can''t be sorted anyway? > > > Gareth > > > On 10/2/07, Diodeus <diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Put the columns in DIVs, float:left with fixed width inside the <li> > > > > On Oct 1, 3:55 pm, "Gareth Evans" <agr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > If using li elements, is there a ''best way'' to handle columns? > > > > > Gareth > > > > > On 10/2/07, Diodeus <diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > Use <li> elements and style them to look like a table. Tables don''t > > > > > play well. > > > > > > On Oct 1, 4:29 am, Sam <sgron...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > New to scriptaculous and just recently got started in web app > > > > > > programming too. > > > > > > > What I would really like to have is a sortable table using > > > > > > Sortable.create and tr as tag. I''ve noticed other people on the list > > > > > > asking for the same thing but no real answers have shown up that I > > > > > > could find. The page for Sortable.create however, says that due to > > > > > > some technical limitation it''s not possible to create a sortable > > > from > > > > > > a table. But a user comment on the page mentioned you could use > > > tbody > > > > > > and tr. So I tried that and while I was able to sort the rows then, > > > I > > > > > > did not get a floating row that follows the mouse cursor as the > > > > > > sortable lists example does. > > > > > > > So I was wondering if there was maybe some workaround. What I want > > > is > > > > > > a sortable collection of rows that contain an amount of subelements > > > > > > that I would like to be aligned with a row of header columns. I was > > > > > > wondering if it might be possible to do it with an unordered list > > > > > > where each column value would be in a span or something that would > > > > > > have a class corresponding to the right column? Do you think that > > > > > > would work? And would it be ok to use span like that?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Sam
2007-Oct-02 16:49 UTC
Re: How to make a list with columns and a header row sortable through drag-and-drop
So, now I kind of got it working by having the following structure: <ul id="list"> <li> <div class="row"> <div class="col_a"><div class="col_b"> and so on... Sortable.create(''list'', {tag:''li''}) But I couldn''t figure out a good way to get the columns to line up when i added a separate div with the column names above the list. So then I tried placing it inside the list the same way as the other rows. Then the list started looking the way I wanted it, but now the column name is also draggable... How would you recommend I solve this? At first I thought maybe Sortable.create would have relied on the id="listname_listname1" attributes. But I don''t have such an attribute defined for the column name list item and it''s still movable. On Oct 2, 4:07 pm, Diodeus <diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Tables need to be manipulated at a DOM node level, whereas <LI> can > easily be rearranged in the HTML. > > See:http://developer.mozilla.org/en/docs/Traversing_an_HTML_table_with_Ja... > > Not that I''m against tables, it''s just I don''t think the drag/drop > script was written to manipulate tables. > > On Oct 2, 4:10 am, Markus Hammer <yaya...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > why do table rows not play well with sortable? > > not that i love tables, but when it comes to tabular data, why > > shouldnt you use tables... > > > On 1 Okt., 22:17, "Gareth Evans" <agr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Thats what I thought, it works except when you want the width to be > > > automatically allocated like a normal table would - and then you have to do > > > calculations on the server side (or client if you prefer) to provide a width > > > %/px based on the width of the table and the number of columns (lets say for > > > this example you dont actually know exactly how many columns, every entity > > > (company/contact/employee etc) has different numbers displayed. > > > > I''m not trying to pick holes in the model, far from it, just trying to hint > > > at tables being useful for, well, tabular data. > > > > What''s the technical reason they can''t be sorted anyway? > > > > Gareth > > > > On 10/2/07, Diodeus <diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Put the columns in DIVs, float:left with fixed width inside the <li> > > > > > On Oct 1, 3:55 pm, "Gareth Evans" <agr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > If using li elements, is there a ''best way'' to handle columns? > > > > > > Gareth > > > > > > On 10/2/07, Diodeus <diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > Use <li> elements and style them to look like a table. Tables don''t > > > > > > play well. > > > > > > > On Oct 1, 4:29 am, Sam <sgron...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > New to scriptaculous and just recently got started in web app > > > > > > > programming too. > > > > > > > > What I would really like to have is a sortable table using > > > > > > > Sortable.create and tr as tag. I''ve noticed other people on the list > > > > > > > asking for the same thing but no real answers have shown up that I > > > > > > > could find. The page for Sortable.create however, says that due to > > > > > > > some technical limitation it''s not possible to create a sortable > > > > from > > > > > > > a table. But a user comment on the page mentioned you could use > > > > tbody > > > > > > > and tr. So I tried that and while I was able to sort the rows then, > > > > I > > > > > > > did not get a floating row that follows the mouse cursor as the > > > > > > > sortable lists example does. > > > > > > > > So I was wondering if there was maybe some workaround. What I want > > > > is > > > > > > > a sortable collection of rows that contain an amount of subelements > > > > > > > that I would like to be aligned with a row of header columns. I was > > > > > > > wondering if it might be possible to do it with an unordered list > > > > > > > where each column value would be in a span or something that would > > > > > > > have a class corresponding to the right column? Do you think that > > > > > > > would work? And would it be ok to use span like that?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Walter Lee Davis
2007-Oct-02 17:38 UTC
Re: How to make a list with columns and a header row sortable through drag-and-drop
On Oct 2, 2007, at 12:49 PM, Sam wrote:> > So, now I kind of got it working by having the following structure: > <ul id="list"> > <li> > <div class="row"> > <div class="col_a"><div class="col_b"> and so on... > Sortable.create(''list'', {tag:''li''}) > > But I couldn''t figure out a good way to get the columns to line up > when i added a separate div with the column names above the list. So > then I tried placing it inside the list the same way as the other > rows. Then the list started looking the way I wanted it, but now the > column name is also draggable... How would you recommend I solve this? > At first I thought maybe Sortable.create would have relied on the > id="listname_listname1" attributes. But I don''t have such an attribute > defined for the column name list item and it''s still movable. >Maybe a whole other UL above the sortable UL to act as your faux TH, or something like that? Walter --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Diodeus
2007-Oct-02 18:52 UTC
Re: How to make a list with columns and a header row sortable through drag-and-drop
Try this: <style> .row { width:282px; } .colA { float:left; width:80px; background-color:#a0a0a0 } .colB { float:left; width:100px; background-color:#b0b0b0 } .colC { float:left; width:100px; background-color:#c0c0c0 } .colEnd { clear:both } </style> </head> <body> <ul id=''list'' type=''none''> <li class=''row''> <div class=''colA''>A1</div> <div class=''colB''>B1</div> <div class=''colC''>C1</div> <div class=''colEnd''></div> </li> <li class=''row''> <div class=''colA''>A2</div> <div class=''colB''>B2</div> <div class=''colC''>C2</div> <div class=''colEnd''></div> </li> </ul> <script language=javascript> Sortable.create("list") </script> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Sam
2007-Oct-03 06:12 UTC
Re: How to make a list with columns and a header row sortable through drag-and-drop
I seemed to get the result I wanted by basically ditching the ul & li- approach completely and just using divs with divs. I hope there are no unforeseen issues that could be caused by that? Anyway, I was wondering about the id for the tag elements that is used in the Sortable Lists Demo. Since the id for the first list is firstlist and the id for item n is firstlist_firstlistn I thought there was a connection between these. But my sortable list works just fine without any ids for the elements. Is it just for when you might want to get and do something with the new ordering of the list? On Oct 2, 9:52 pm, Diodeus <diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Try this: > > <style> > .row { > width:282px;} > > .colA { > float:left; > width:80px; > background-color:#a0a0a0} > > .colB { > float:left; > width:100px; > background-color:#b0b0b0} > > .colC { > float:left; > width:100px; > background-color:#c0c0c0} > > .colEnd { > clear:both} > > </style> > </head> > <body> > <ul id=''list'' type=''none''> > <li class=''row''> > <div class=''colA''>A1</div> > <div class=''colB''>B1</div> > <div class=''colC''>C1</div> > <div class=''colEnd''></div> > </li> > <li class=''row''> > <div class=''colA''>A2</div> > <div class=''colB''>B2</div> > <div class=''colC''>C2</div> > <div class=''colEnd''></div> > </li> > </ul> > <script language=javascript> > Sortable.create("list") > </script>--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Walter Lee Davis
2007-Oct-03 11:57 UTC
Re: How to make a list with columns and a header row sortable through drag-and-drop
Yes. If you follow the convention, then sortable.serialize will give you a nice neat array of the item ids. Note that the first part before the underscore doesn''t matter, it just needs to be page- unique. There''s no particular magic in using the name of the element, this part just gets thrown away when calculating the order array. Walter On Oct 3, 2007, at 2:12 AM, Sam wrote:> But my sortable list works just fine without > any ids for the elements. Is it just for when you might want to get > and do something with the new ordering of the list?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Matt Foster
2007-Oct-03 16:08 UTC
Re: How to make a list with columns and a header row sortable through drag-and-drop
This doesn''t have drag and drop rows but it has a bunch of really awesome table behaviors and its built on top of prototype http://www.millstream.com.au/view/code/tablekit/ On Oct 3, 7:57 am, Walter Lee Davis <wa...-HQgmohHLjDZWk0Htik3J/w@public.gmane.org> wrote:> Yes. If you follow the convention, then sortable.serialize will give > you a nice neat array of the item ids. Note that the first part > before the underscore doesn''t matter, it just needs to be page- > unique. There''s no particular magic in using the name of the element, > this part just gets thrown away when calculating the order array. > > Walter > > On Oct 3, 2007, at 2:12 AM, Sam wrote: > > > But my sortable list works just fine without > > any ids for the elements. Is it just for when you might want to get > > and do something with the new ordering of the list?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Diodeus
2007-Oct-03 18:08 UTC
Re: How to make a list with columns and a header row sortable through drag-and-drop
I just took a quick peek at TableKit - good job! On Oct 3, 12:08 pm, Matt Foster <mattfoste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> This doesn''t have drag and drop rows but it has a bunch of really > awesome table behaviors and its built on top of prototype > > http://www.millstream.com.au/view/code/tablekit/ > > On Oct 3, 7:57 am, Walter Lee Davis <wa...-HQgmohHLjDZWk0Htik3J/w@public.gmane.org> wrote: > > > Yes. If you follow the convention, then sortable.serialize will give > > you a nice neat array of the item ids. Note that the first part > > before the underscore doesn''t matter, it just needs to be page- > > unique. There''s no particular magic in using the name of the element, > > this part just gets thrown away when calculating the order array. > > > Walter > > > On Oct 3, 2007, at 2:12 AM, Sam wrote: > > > > But my sortable list works just fine without > > > any ids for the elements. Is it just for when you might want to get > > > and do something with the new ordering of the list?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---