I have created a web application in which I have 3 columns, or i would say left sidebar, right sidebar and a middle widget area, I have few widgets in the left sidebar, few in the right sidebar and few in the middle widget area to give it a look of igoogle. Each user will have his widgets and then will also be able to drag and drop those widgets.I have added the drag and drop functionality of the widgets. What I want now is to save the dropped widgets position in the database and retrieve it for the user when he/she logs in again. Any sugestions as to how this can be done?
-
This doesn't have anything to do with WordPress specifically ... I recommend asking on StackOverflow.– EAMannCommented Oct 20, 2010 at 20:18
-
nopes i need it in wordpress particularly, i have one for simple web and database saving sample also, but that is not helpful anyways for a web application in wordpress– MsManiyaCommented Oct 20, 2010 at 20:25
-
Please explain in more detail how this applies to WordPress. As it is, I agree that it should be closed.– Travis NorthcuttCommented Oct 20, 2010 at 21:20
-
My website has widgets and the widgets can be dragged and dropped in the UI. I want to save the changed position of the widget with respect to each user and update it to the last moved/dropped positions of the widgets respectively when the user logs in again. How will i save the widgets changed position and update it the next time user logs in.I want this to be done in wordpress.– MsManiyaCommented Oct 21, 2010 at 8:34
Add a comment
|
1 Answer
If each user is registered as a WordPress user (and thus exists in the users
table), you can save user metadata on each reordering operation. You would communicate back to the server via Ajax (via admin-ajax.php
, this also works for non-admin stuff). Serialize the current order to a JSON string, send it to the server to save it, and when the user visits again read this value and order the widgets according to it.