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

Revision

Revision 466 | Revision 470 | Zur aktuellen Revision | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

{extends file="index.tpl"}
{block name="maincontent"}
    <link rel="stylesheet" href="/js/jstree/dist/themes/default/style.min.css"/>
    <script src="/js/jstree/dist/jstree.min.js"></script>
    <div style="display: flex">
        <div style="width: 300px;">
            <div id="tree"></div>
        </div>
        <div style="display: flex;flex: 1 0 0">
            <iframe id="tool" style="display:block;height: 100%;width: 1px;min-width: 100%"></iframe>
        </div>
    </div>
    <script>
        $(function () {
            $('#tree').jstree({
                'core': {
                    "check_callback": true,
                },
                "json_data":
                    {
                        "ajax": {
                            "type": "GET",
                            "dataType": "json",
                            "async": true,
                            "url": function (node) {
                                let nodeId;
                                nodeId = node.id;
                                let url = "/Online-Shop/tree?id=" + nodeId;
                                console.log(url);
                                return url;
                            },
                            "success": function (new_data) {
                                return new_data;
                            },
                            error:function (response)
                            {
                                console.log(response);
                            }
                        },
                    },
                "plugins": ["dnd", "contextmenu", "json_data"],
            }).on("changed.jstree", function (e, data) {
                let dId = data.instance.get_node(data.selected[0]).id;
                $('#tool').attr("src", "/Online-Shop/directory/" + dId + "/edit");
            })
        })
    </script>
{/block}