ognen.plavevski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jun-05 13:39 UTC
passing dynamic parameters?
I''m trying to create sortables programatically. If i do Sortable.create(sections[i], {tag:''div'',dropOnEmpty:true,containment: ["group1","group2","group3","group4","page"],constraint:false}); then it works. But since i want to create sortables dynamically, if i pass the group as var groups = ''"group1","group2"...'' and do Sortable.create(sections[i],{tag:''div'',dropOnEmpty:true,containment: [groups]... then this doesn''t work. Same goes if i try it as an array... var groups = ["group1","group2"...] Sortable.create(sections[i],{tag:''div'',dropOnEmpty:true,containment: [groups]... How do i pass the groups in order for it to work? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hey Ognen, ognen.plavevski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org a écrit :> Same goes if i try it as an array... > var groups = ["group1","group2"...] > Sortable.create(sections[i],{tag:''div'',dropOnEmpty:true,containment: > [groups]...OK, why put your groups array within *another* array? Just go: containment: groups Cheers, -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
ognen.plavevski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jun-05 14:00 UTC
Re: passing dynamic parameters?
Retard... (not you, me...) Thanks, works like a charm:) On Jun 5, 3:48 pm, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> Hey Ognen, > > ognen.plavev...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org a écrit : > > > Same goes if i try it as an array... > > var groups = ["group1","group2"...] > > Sortable.create(sections[i],{tag:''div'',dropOnEmpty:true,containment: > > [groups]... > > OK, why put your groups array within *another* array? Just go: > > containment: groups > > Cheers, > > -- > Christophe Porteneuve aka TDD > t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---