jstree will not fire onchange event

Posted by vasion on Stack Overflow See other posts from Stack Overflow or by vasion
Published on 2010-05-11T19:49:56Z Indexed on 2010/05/11 19:54 UTC
Read the original article Hit count: 668

Filed under:
|
|

i have been really stuck on this. this is the code:

js:

var treeoptions={"data":{"type":"json","opts":{"url":"\/surveytags\/treejson"}}};
$('#treecontainer').tree(treeoptions);
$("#treecontainer").tree({
    callback : {
                    ondblclk : function (node, tree) {
            alert(node.id);
        },
                    onmove : function (node,ref,type){
                             data= new Object();
                             data.node= new Object();
                             data.node.id = node.id;
                             data.ref=new Object();
                             data.ref.id = ref.id;
                             data.type = type;
                             moveitem(data);
                    },
                    onchange : function (){
                        alert('focused');
                    },
                    oncreate : function(node){
                        alert('create');
                        alert(node.data);
                    }

    }
});

this is the json:

{"attributes":{"id":"1"},"data":{"title":"root"},"children":[{"attributes":{"id":"2"},"data":{"title":"blah"},"children":[{"attributes":{"id":"3"},"data":{"title":"tworows down"}},{"attributes":{"id":"4"},"data":{"title":"tooope"}}]}]}

it loads. other events fire. BUT onchange will not...

© Stack Overflow or respective owner

Related posts about jstree

Related posts about focus