1

This fiddle attempts to access the modified tree data and display it to console when a node is moved and/or dropped :

The tree in question is based on jqTree : https://mbraak.github.io/jqTree/

http://jsfiddle.net/adrianfiddleuser/ywo3z1rb/3/

But the alert is not firing.

fiddle src :

HTML :

<div id="tree1"></div>

javascript + jQuery :

var data = [
    {
        label: 'node1',
        children: [
            { label: 'child1' },
            { label: 'child2' }
        ]
    },
    {
        label: 'node2',
        children: [
            { label: 'child3' }
        ]
    }
];
$('#tree1').tree({
    data: data,
    autoOpen: true,
    dragAndDrop: true,
    "check_callback" : true
}).on("copy_node.jstree", function () {
            alert("copy_node fires");
            console.log(data)
        }).on("move_node.jstree", function () {
            alert("move_node fires");
            console.log(data)
        });

How to fire the alert and access the modified tree json structure ? I'm not using on correctly ?

blue-sky
  • 51,962
  • 152
  • 427
  • 752
  • 1
    You are not using correct event see [docs](https://mbraak.github.io/jqTree/#event-tree-move) here is a fiddle link http://jsfiddle.net/ze4w6b9c/ – Satpal Jun 07 '19 at 07:38

0 Answers0