How can I store the state of draggables and droppables from jquery UI into JSON? I want to save the state and retrieve them back using JSON. Is this the best way or alternate ways are also possible?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use the callbackhandlers of the draggable/Droppable events to get the values which have changed.
You could save those values using localStorage/sessionStorage, so you don’t need to save the data to the server.
There is also an polyfill for the Storage API you can use for IE.
Try something like this:
you now can retrieve the position:
Note: this is only a starting point! E.g. you first have to check if localStorage, so please dont take this as complete solution!