Canman2005 Posted October 2, 2009 Share Posted October 2, 2009 Hi all I have found this script which is perfect http://sandbox.tinctuur.be/tree/ how easy would it be to store the position and menu options in a database and update the position of each using PHP? Thanks Link to comment https://forums.phpfreaks.com/topic/176301-drag-and-drop-menu/ Share on other sites More sharing options...
Canman2005 Posted October 3, 2009 Author Share Posted October 3, 2009 I've managed to add in the following to that code <script> function ajaxLoader(url,id) { if (document.getElementById) { var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); } if (x) { x.onreadystatechange = function() { el = document.getElementById(id); el.innerHTML = ""; if (x.readyState == 4 && x.status == 200) { el = document.getElementById(id); el.innerHTML = x.responseText; } } x.open("GET", url, true); x.send(null); } } </script> <script> $(document).ready(function(){ $("ul.sortable").tree({ dropOn: ".item_name", placeholder: 'placeholder', tabSize: 20, maxDepth: 2, maxDepthError: 'ui-tree-deptherror', maxDepthErrorText: 'Only three levels are alowed!', maxItems: [7], maxItemsError: 'ui-tree-limiterror', maxItemsErrorText: 'You have reached the maximum number of items for this level!' }); $("#serializebtn").click(function(){ var sorte = $("ul.sortable").tree("serialize"); ajaxLoader('update.php?action='+sorte+'','content'); }); }); </script> <span id="content"></span> which posts to a database when the <a href="#" id="serializebtn">serialize</a> link is clicked. but it is only inserting list[]=1 into the database. how can I get it to post the correct data? thanks Link to comment https://forums.phpfreaks.com/topic/176301-drag-and-drop-menu/#findComment-929632 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.