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 Quote Link to comment 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 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.