Re: saving state?

Matt Foster
Thu, 23 Aug 2007 20:19:24 -0000

You''ll want to use the onUpdate event in the Sortable class.  I am
pretty sure there are a bunch of serialize functions that you can use
to stash data about a Sortable.  You could put the serialized data
into a cookie and parse it on window load to reoganize the sortables
so they look just as the user had left it.

On Aug 23, 3:43 pm, "ddsh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
<ddsh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
> Sorry, i''m new to javascript/ajax but how would i go about saving
the
> state of a sortable element on page refresh?
>
> currently i have a menu that is sortable, so i can drag and drop it
> and then move it into a new position.
>
> however, i''m not certain how to save it.  I would assume it would
> involve cookies(as i will want it to be on seperate visits as well), i
> also have a mysql database, so if that would work as well for storing
> it for longer periods of times.
>
> But i''m not sure when to create the cookie, what to store in it,
and
> then how to load it for the application so it will load on page
> load(the site is in php if that helps).
>
> Again, sorry for the inexperience, but I haven''t been having much
luck
> yet.