I have a big problem, I need to save an AJAXed ordered list as a menu, I found a script here: http://www.prodevtips.com/2010/03/07/jquery-drag-and-drop-to-sort-tree/ it works great, except that I need to save it to my database and the author says you can do it with JSON. Here is the part he says can process and save the data.
$("#save").click(function(){
/*
var tree = $.toJSON(parseTree($("#tag_tree")));
$.post("@saveTags", {tags: tree}, function(res){
$("#printOut").html(res);
});
*/
$.debug.print_r(parseTree($("#tag_tree")), "printOut", false);
});
the debug outputs an array like :
'0' => "Economics"
'1' => "Blogging"
'2' => "General Dev"
'3' => "Japan"
'4' ...
'0' => "Productivity"
'1' ...
'0' ...
'0' => "Humanities"
'3' => "CMS"
What I need is to be able to save the id, parent id and the order. It seems that i'm not able to save them into the database.
I know i need a php file to save the data to the database but i don't know how to pass the data to that php file. This is with what i need help, how can i pass the data to a php file in this case?
Thanks, Dan