Subversion-Projekte lars-tiefland.webanos.marine-sales.de

Revision

Revision 470 | Revision 473 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 470 Revision 471
Zeile 11... Zeile 11...
11
        </div>
11
        </div>
12
    </div>
12
    </div>
13
    <script>
13
    <script>
14
        $(function () {
14
        $(function () {
15
            $('#tree').jstree({
15
            $('#tree').jstree({
16
                "plugins": ["dnd", "contextmenu", "json_data"],
16
                "plugins": ["dnd", "contextmenu"],
17
                'core': {
17
                'core': {
18
                    "check_callback": true,
18
                    "check_callback": true,
-
 
19
                    "data":{
-
 
20
                        "url":"/Online-Shop/tree",
-
 
21
                        "data":function(node)
-
 
22
                        {
-
 
23
                            return { "id" : node.id },
-
 
24
                        }
-
 
25
                    }
19
                },
26
                },
20
                "json_data":
-
 
21
                    {
-
 
22
                        "ajax": {
-
 
23
                            "type": "GET",
-
 
24
                            "dataType": "json",
-
 
25
                            "async": true,
-
 
26
                            "url": function (node) {
-
 
27
                                let nodeId;
-
 
28
                                nodeId = node.id;
-
 
29
                                let url = "/Online-Shop/tree?id=" + nodeId;
-
 
30
                                console.log(url);
-
 
31
                                return url;
-
 
32
                            },
-
 
33
                            "success": function (new_data) {
-
 
34
                                return new_data;
-
 
35
                            },
-
 
36
                            error:function (response)
-
 
37
                            {
-
 
38
                                console.log(response);
-
 
39
                            }
-
 
40
                        },
-
 
41
                    },
-
 
42
            }).on("changed.jstree", function (e, data) {
27
            }).on("changed.jstree", function (e, data) {
43
                let dId = data.instance.get_node(data.selected[0]).id;
28
                let dId = data.instance.get_node(data.selected[0]).id;
44
                $('#tool').attr("src", "/Online-Shop/directory/" + dId + "/edit");
29
                $('#tool').attr("src", "/Online-Shop/directory/" + dId + "/edit");
45
            })
30
            })
46
        })
31
        })