Folks, It has been a whole day spent on this but I still can''t get my mind around the most probably very stupid/basic mistake here... First, the code I use: <h3>List A</h3> <ul id="lista" > <li id="item1"> Item 1</li> <li id="item2"> Item 2</li> <li id="item3"> Item 3</li> </ul> <h3>List B</h3> <ul id="listb"> <li id="item4"> Item 4</li> <li id="item5"> Item 5</li> </ul> <%= sortable_element "lista", :containment => "list", :url => { :action => "lista_action" } %> <%= sortable_element "listb", :droponempty => true, :complete => visual_effect(:highlight, ''listb''), :containment => ["lista", "listb"], :url => { :action => "listb_action" } %> Next the things that are getting me crazy: 1 - I CAN''T get listb_action or lista_action to get called. Why ???... Arghhh.. 2 - When I drop Item 3 on top of listb, Item 4 cannot be dragged above Item 3. 3 - How can I obtain a ''duplicate-and-drop'' effect, ie ensure that lista are only duplicated to listb rather than trully move from a to b ? Your help is greatly appreciated... This is really getting on my nerves (especially question 1!) Jb
<%= sortable_element "lista", :containment => "list", :url => { :action => "lista_action" } %> I don''t think you can write :containment=>"list" you have to use the markup id''s and it doesn''t look like you have anything marked up with id "list" For your number three, I''m working on it. Eventually I want to be able to update the scriptaculous draganddrop.js but work is getting in the way. Peter On 2/27/06, Jb Piacentino <jb-ThRHXUlDcLnGg37QOHVfPA@public.gmane.org> wrote:> Folks, > > It has been a whole day spent on this but I still can''t get my mind > around the most probably very stupid/basic mistake here... First, the > code I use: > > <h3>List A</h3> > <ul id="lista" > > <li id="item1"> Item 1</li> > <li id="item2"> Item 2</li> > <li id="item3"> Item 3</li> > </ul> > > <h3>List B</h3> > <ul id="listb"> > <li id="item4"> Item 4</li> > <li id="item5"> Item 5</li> > </ul> > > <%= sortable_element "lista", > :containment => "list", > :url => { :action => "lista_action" } %> > > <%= sortable_element "listb", > :droponempty => true, > :complete => visual_effect(:highlight, ''listb''), > :containment => ["lista", "listb"], > :url => { :action => "listb_action" } %> > > Next the things that are getting me crazy: > 1 - I CAN''T get listb_action or lista_action to get called. Why ???... > Arghhh.. > 2 - When I drop Item 3 on top of listb, Item 4 cannot be dragged above > Item 3. > 3 - How can I obtain a ''duplicate-and-drop'' effect, ie ensure that lista > are only duplicated to listb rather than trully move from a to b ? > > Your help is greatly appreciated... This is really getting on my nerves > (especially question 1!) > > Jb > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >
Peter, Thanks for the answer. As a matter of fact, this is a left-over from an intentional typo which I found allowed me to avoid the sorting effect on lista - in fact, I just want to have lista as a repository of items I get get feeds for listb from. Any idea on question 1 ? Why does onUpdate not executed ?... Gnnnn! Jb -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Peter Michaux Sent: lundi 27 février 2006 21:16 To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails-spinoffs] Getting nuts with sortables... <%= sortable_element "lista", :containment => "list", :url => { :action => "lista_action" } %> I don''t think you can write :containment=>"list" you have to use the markup id''s and it doesn''t look like you have anything marked up with id "list" For your number three, I''m working on it. Eventually I want to be able to update the scriptaculous draganddrop.js but work is getting in the way. Peter On 2/27/06, Jb Piacentino <jb-ThRHXUlDcLnGg37QOHVfPA@public.gmane.org> wrote:> Folks, > > It has been a whole day spent on this but I still can''t get my mind > around the most probably very stupid/basic mistake here... First, the > code I use: > > <h3>List A</h3> > <ul id="lista" > > <li id="item1"> Item 1</li> > <li id="item2"> Item 2</li> > <li id="item3"> Item 3</li> > </ul> > > <h3>List B</h3> > <ul id="listb"> > <li id="item4"> Item 4</li> > <li id="item5"> Item 5</li> > </ul> > > <%= sortable_element "lista", > :containment => "list", > :url => { :action => "lista_action" } %> > > <%= sortable_element "listb", > :droponempty => true, > :complete => visual_effect(:highlight, ''listb''), > :containment => ["lista", "listb"], > :url => { :action => "listb_action" } %> > > Next the things that are getting me crazy: > 1 - I CAN''T get listb_action or lista_action to get called. Why ???...> Arghhh.. 2 - When I drop Item 3 on top of listb, Item 4 cannot be > dragged above Item 3. > 3 - How can I obtain a ''duplicate-and-drop'' effect, ie ensure thatlista> are only duplicated to listb rather than trully move from a to b ? > > Your help is greatly appreciated... This is really getting on my > nerves (especially question 1!) > > Jb > > _______________________________________________ > Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
> Any idea on question 1 ? Why does onUpdate not executed ?... Gnnnn!onUpdate won''t fire unless you name your items as "item_1" instead of "item1" (in the id of the LI elements). It uses Sortable.serialize to determine if the value has changed, and that function relies on ids formatted in that way. Greg
Greg, That is indeed something I have missed... And thanks for the code insight :-) But anyway, replacing all my itemx by item_x does seem to have any effect... :-( Jb -----Original Message----- From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Gregory Hill Sent: mardi 28 février 2006 00:08 To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: RE: [Rails-spinoffs] Getting nuts with sortables...> Any idea on question 1 ? Why does onUpdate not executed ?... Gnnnn!onUpdate won''t fire unless you name your items as "item_1" instead of "item1" (in the id of the LI elements). It uses Sortable.serialize to determine if the value has changed, and that function relies on ids formatted in that way. Greg _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org lists.rubyonrails.org/mailman/listinfo/rails-spinoffs