I followed the example mentioned in
http://demo.script.aculo.us/ajax/sortable_elements
I am able to drag and drop Number1 to Number 6
But my problem is ....
Updated order always gives me the last number that is placed last in
the list.
That is if I replace Number6 with Number5,
it shows Updated Order:5
And also the params[:list] always give the last number in the list.
There is some prob that is hiddden. I tried all possibilities. But...
It never show me the entire array.
Please Help Plssss!
Rails version(V1.1.6)
Scriptaclous version(1.6.5)
in the demo it shows the entire array joined with '',''
Updated Order : 2,1,3,4,5,6 ( if i move Number2 above Number1)
Source :
# view
<ul id="list">
<% 6.times do |i| -%>
<li id="item_<%= i+1 %>">I''m number <%= i+1
%></li>
<% end -%>
</ul>
<p id="list-info"></p>
<%= sortable_element ''list'',
:update => ''list-info'',
:complete => visual_effect(:highlight, ''list''),
:url => { :action => "order" } %>
# controller
def order
@order = params[:list]
render :partial => ''list''
end
# _list.rhtml partial
Updated order is: <%= @order.join('', '') %>.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
I ran into the same problem and rolled back to scriptaculous 1.6.4 which fixed the problem. On Nov 15, 3:29 am, "Carolene" <kiran.sou...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I followed the example mentioned in > > http://demo.script.aculo.us/ajax/sortable_elements > > I am able to drag and drop Number1 to Number 6 > > But my problem is .... > > Updated order always gives me the last number that is placed last in > the list. > > That is if I replace Number6 with Number5, > it shows Updated Order:5 > > And also the params[:list] always give the last number in the list. > There is some prob that is hiddden. I tried all possibilities. But... > > It never show me the entire array. > > Please Help Plssss! > > Rails version(V1.1.6) > Scriptaclous version(1.6.5) > > in the demo it shows the entire array joined with '','' > Updated Order : 2,1,3,4,5,6 ( if i move Number2 above Number1) > > Source : > > # view > <ul id="list"> > <% 6.times do |i| -%> > <li id="item_<%= i+1 %>">I''m number <%= i+1 %></li> > <% end -%> > </ul> > > <p id="list-info"></p> > > <%=sortable_element''list'', > :update => ''list-info'', > :complete => visual_effect(:highlight, ''list''), > :url => { :action => "order" } %> > > # controller > def order > @order = params[:list] > render :partial => ''list'' > end > > # _list.rhtml partial > Updated order is: <%= @order.join('', '') %>.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Andrew Kaspick
2006-Nov-24 01:40 UTC
Re: Problem when implementing Scriptaculous Sortable list.
I don''t think scriptaculous is broken, but the newest Prototype is what''s mangling the parameters for the url. Sortable.serialize seems to be doing the right thing, but Ajax.Request doesn''t handle it correctly anymore. On 11/16/06, dnorton <dnorton-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I ran into the same problem and rolled back to scriptaculous 1.6.4 > which fixed the problem. > > On Nov 15, 3:29 am, "Carolene" <kiran.sou...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I followed the example mentioned in > > > > http://demo.script.aculo.us/ajax/sortable_elements > > > > I am able to drag and drop Number1 to Number 6 > > > > But my problem is .... > > > > Updated order always gives me the last number that is placed last in > > the list. > > > > That is if I replace Number6 with Number5, > > it shows Updated Order:5 > > > > And also the params[:list] always give the last number in the list. > > There is some prob that is hiddden. I tried all possibilities. But... > > > > It never show me the entire array. > > > > Please Help Plssss! > > > > Rails version(V1.1.6) > > Scriptaclous version(1.6.5) > > > > in the demo it shows the entire array joined with '','' > > Updated Order : 2,1,3,4,5,6 ( if i move Number2 above Number1) > > > > Source : > > > > # view > > <ul id="list"> > > <% 6.times do |i| -%> > > <li id="item_<%= i+1 %>">I''m number <%= i+1 %></li> > > <% end -%> > > </ul> > > > > <p id="list-info"></p> > > > > <%=sortable_element''list'', > > :update => ''list-info'', > > :complete => visual_effect(:highlight, ''list''), > > :url => { :action => "order" } %> > > > > # controller > > def order > > @order = params[:list] > > render :partial => ''list'' > > end > > > > # _list.rhtml partial > > Updated order is: <%= @order.join('', '') %>. > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Andrew Kaspick
2006-Nov-24 02:02 UTC
Re: Problem when implementing Scriptaculous Sortable list.
svn prototype seems to fix it. On 11/23/06, Andrew Kaspick <akaspick-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I don''t think scriptaculous is broken, but the newest Prototype is > what''s mangling the parameters for the url. > > Sortable.serialize seems to be doing the right thing, but Ajax.Request > doesn''t handle it correctly anymore. > > On 11/16/06, dnorton <dnorton-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I ran into the same problem and rolled back to scriptaculous 1.6.4 > > which fixed the problem. > > > > On Nov 15, 3:29 am, "Carolene" <kiran.sou...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I followed the example mentioned in > > > > > > http://demo.script.aculo.us/ajax/sortable_elements > > > > > > I am able to drag and drop Number1 to Number 6 > > > > > > But my problem is .... > > > > > > Updated order always gives me the last number that is placed last in > > > the list. > > > > > > That is if I replace Number6 with Number5, > > > it shows Updated Order:5 > > > > > > And also the params[:list] always give the last number in the list. > > > There is some prob that is hiddden. I tried all possibilities. But... > > > > > > It never show me the entire array. > > > > > > Please Help Plssss! > > > > > > Rails version(V1.1.6) > > > Scriptaclous version(1.6.5) > > > > > > in the demo it shows the entire array joined with '','' > > > Updated Order : 2,1,3,4,5,6 ( if i move Number2 above Number1) > > > > > > Source : > > > > > > # view > > > <ul id="list"> > > > <% 6.times do |i| -%> > > > <li id="item_<%= i+1 %>">I''m number <%= i+1 %></li> > > > <% end -%> > > > </ul> > > > > > > <p id="list-info"></p> > > > > > > <%=sortable_element''list'', > > > :update => ''list-info'', > > > :complete => visual_effect(:highlight, ''list''), > > > :url => { :action => "order" } %> > > > > > > # controller > > > def order > > > @order = params[:list] > > > render :partial => ''list'' > > > end > > > > > > # _list.rhtml partial > > > Updated order is: <%= @order.join('', '') %>. > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---