avibitton Posted June 13, 2012 Share Posted June 13, 2012 Hi Im having a problem saving drag &drop elements , i have 4 icons which need which need to be dragged to a specific div(lets call him room for example) , than i must save the position of this icons at that div , i know that i should use the div Id and than in one way or other to send his him to database , since i never done such thing before i dont know where to start , i got an Hint that i should use selector in jquery instead of getElementById cause it more simple , and than save this div in database and when im doing refresh to the page i can see the same position of the icons as left before the refresh , it will be nice if someone can help me or guide me , in the file attachment the id of the div i need to save in the database its "droppable " thx Avi . 18596_.php Quote Link to comment Share on other sites More sharing options...
scootstah Posted June 14, 2012 Share Posted June 14, 2012 The easiest way would be to throw an AJAX call into droppable's drop event. The AJAX call would send whatever information you need to a PHP script which would save the information to a database. Quote Link to comment Share on other sites More sharing options...
avibitton Posted June 14, 2012 Author Share Posted June 14, 2012 Hi thx for the reply , but im new at php and jquery , what i need its to save to position of the icons which i dropped for the next time i will view the page . i dont know what is more easy: to get the position of the icons and send them to database , or send the div(the html of the div) which will contain everything including the position of the icons. honestly i dont know how to get the position of the icons and send it to database . thx avi . Quote Link to comment Share on other sites More sharing options...
Mahngiel Posted June 14, 2012 Share Posted June 14, 2012 you'll need a [tt]priority[tt] column in your table to which the arrangement changes. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.