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

Revision

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

Revision 459 Revision 462
Zeile 13... Zeile 13...
13
    <script>
13
    <script>
14
        $(function () {
14
        $(function () {
15
            $('#tree').jstree({
15
            $('#tree').jstree({
16
                'core': {
16
                'core': {
17
                    "check_callback": true,
17
                    "check_callback": true,
18
                    'data': {
-
 
19
                        "url": "/Online-Shop/tree/",
-
 
20
                        "data":function(node)
-
 
21
                        {
-
 
22
                            let nodeId;
-
 
23
                            if(node.id==="#")
-
 
24
                            {
-
 
25
                                nodeId=-1;
-
 
26
                            }
-
 
27
                            else
-
 
28
                            {
-
 
29
                                nodeId=node.id;
-
 
30
                            }
-
 
31
                            let daten= {
-
 
32
                                "id": nodeId
-
 
33
                            }
-
 
34
                            return daten;
-
 
35
                        },
-
 
36
                        "async":true,
-
 
37
                        "dataType": "json" // needed only if you do not supply JSON headers
-
 
38
                    }
18
                    }
39
                },
19
                },
-
 
20
                "json_data":
-
 
21
                {
-
 
22
                    "ajax":{
-
 
23
                        "type":"GET",
-
 
24
                        "url":function(node) {
-
 
25
                            let nodeId;
-
 
26
                            nodeId=node.id;
-
 
27
                            let url="/Online-Shop/tree?id="+ nodeId;
-
 
28
                            return url;
-
 
29
                        },
-
 
30
                        "success":function(new_data) {
-
 
31
                            return new_data;
-
 
32
                        }
-
 
33
                    },
-
 
34
                }
40
                "plugins" : ["dnd","contextmenu"],
35
                "plugins" : ["dnd","contextmenu","json_data"],
41
            }).on("changed.jstree", function (e, data) {
36
            }).on("changed.jstree", function (e, data) {
42
                let dId=data.instance.get_node(data.selected[0]).id;
37
                let dId=data.instance.get_node(data.selected[0]).id;
43
                $('#tool').attr("src","/Online-Shop/directory/"+dId+"/edit");
38
                $('#tool').attr("src","/Online-Shop/directory/"+dId+"/edit");
44
            })
39
            })
45
        })
40
        })
46
    </script>
41
    </script>
47
{/block}
-
 
48
42
{/block}
-
 
43
 
-
 
44