Carolene
2006-Sep-28 04:42 UTC
Is it possible to save the changes made to Sortable list in a cookie
Using Ruby on Rails, Is it possible to save the user changes made to a sortable list of drag and drop in any cookie???(so that when he opens the browser again he sees his own arranged dom elements ) Is it possible to save his preference? Can anyone help me in this plz??? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Peter Michaux
2006-Sep-28 05:37 UTC
Re: Is it possible to save the changes made to Sortable list in a cookie
> Is it possible to save the user changes made to a sortable list of drag > and drop in any cookie???(so that when he opens the browser again he > sees his own arranged dom elements ) > > Is it possible to save his preference? > > Can anyone help me in this plz???Yes you could do this saving to a cookie. I think the more Rails way to do it would be this... After the user changes the order of the list, send an AJAX request to the server with the new order. Save this new order in the session. Then use the order saved in the session when generating the page the next time the user visits. Peter --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Carolene
2006-Sep-28 09:05 UTC
Re: Is it possible to save the changes made to Sortable list in a cookie
Thanks for your reply.... I understood till the point i save it in the session.. I also started implementing and am able to save the order of the list in a session but I am facing difficulty of rendering the the page in the order desired. Can u pls let me know to render as desired.. i mean how to assign the list before it renders.....??? Thank you Thanks a lot!> > Yes you could do this saving to a cookie. I think the more Rails way > to do it would be this... > > After the user changes the order of the list, send an AJAX request to > the server with the new order. Save this new order in the session. > Then use the order saved in the session when generating the page the > next time the user visits. > > Peter--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Carolene
2006-Sep-28 15:10 UTC
Re: Is it possible to save the changes made to Sortable list in a cookie
Finally, i have done it! I used Sortable.setSequence, which i am unaware of it before! I need to know a lot! And i will,,,! Thanks for your GREAT clue! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Peter Michaux
2006-Sep-29 08:08 UTC
Re: Is it possible to save the changes made to Sortable list in a cookie
If you have the order saved in the session on the server, when a user changes computers, if they login and you restore the session, then their previous order will be restored. If the order is only stored in the cookies then if they change computers the order is lost. Peter On 9/28/06, Carolene <kiran.soumya-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Finally, i have done it! > > I used Sortable.setSequence, which i am unaware of it before! I need to > know a lot! And i will,,,! > > Thanks for your GREAT clue! > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---