Craig Hopson Posted June 17, 2013 Share Posted June 17, 2013 Hi guys i have a question i have this Jquery function which works fine $(function () { $(".Movable").sortable({ tolerance: 'pointer', revert: 'invalid', placeholder: 'span2 well placeholder tile', forceHelperSize: true, update: function(event, ui) { order = $('.Movable').sortable("toArray"); $.ajax({ type: 'GET', url: My_Site+'/themes/mytheme-2/ajax.php?task=Order&user_id='+User_ID+'&orderby='+order, timeout: 2000 }); } }); }); It saves it into a mysql database under the users_id SO my question is how do i reverse the function to get the order via AJAX and sort the .Movable class Thanks Link to comment Share on other sites More sharing options...
0 Craig Hopson Posted June 17, 2013 Author Share Posted June 17, 2013 ok i've updated the function to this $(function () { $(".Movable").sortable({ tolerance: 'pointer', revert: 'invalid', placeholder: 'span2 well placeholder tile', forceHelperSize: true, update: function(event, ui) { order = $('.Movable').sortable("toArray"); $.ajax({ type: 'POST', dataType: 'json', url: My_Site+'/themes/mytheme-2/ajax.php?task=Order&user_id='+User_ID, timeout: 2000, data: {orderby:order} }); } }); }); and this is the value that is saved ["friends","notifications","messages","search","member_online","new_member"] SO how do sort the div's by "id" as saved Link to comment Share on other sites More sharing options...
Question
Craig Hopson
Hi guys i have a question i have this Jquery function which works fine
It saves it into a mysql database under the users_id
SO my question is how do i reverse the function to get the order via AJAX and sort the .Movable class
Thanks
Link to comment
Share on other sites
1 answer to this question
Recommended Posts