Welcome Guest, Not a member yet? Register   Sign In
Jquery Drag and Drop to create menu (similar to wordpress custom menus)
#2

[eluser]Dan Tdr[/eluser]
i found something that, i think would fit exactly to what i want, but i'm not an expert in JSON so i don't know hot to configure it. :
http://www.prodevtips.com/2010/03/07/jqu...sort-tree/

this is just a bit of code.
Code:
$("#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);
    });

on save it outputs :

Code:
'0' => "Economics"
    '1' => "Blogging"
    '2' => "General Dev"
    '3' => "Japan"
    '4' ...
        '0' => "Productivity"
        '1' ...
            '0' ...
                '0' => "Humanities"
    '3' => "CMS"

the author says that with the commented code you can save the data in the database but i can't seem to figure out how to do that.
I just need to pass the id, parent id(if exists or 0 if not), and order


Messages In This Thread
Jquery Drag and Drop to create menu (similar to wordpress custom menus) - by El Forum - 04-11-2011, 05:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB