Callbacks

You can view how callbacks are called here.

You can drop me on the tree
$(function () {
    $("#demo").tree({
      // Rest omitted
      rules : {
        droppable : [ "tree-drop" ],
        multiple : true,
        deletable : "all",
        draggable : "all"
      },
      callback : {
        beforechange: function() { log("About to change"); return true },
        beforeopen	: function() { log("About to open"); return true },
        beforeclose	: function() { log("About to close"); return true },
        beforemove  : function() { log("About to move"); return true }, 
        beforecreate: function() { log("About to create"); return true }, 
        beforerename: function() { log("About to rename"); return true }, 
        beforedelete: function() { log("About to delete"); return true }, 
        onselect	: function() { log("Select"); },
        ondeselect	: function() { log("Deselect"); },
        onchange	: function() { log("Focus changed"); },
        onrename	: function() { log("Rename"); },
        onmove		: function() { log("Move"); },
        oncopy		: function() { log("Copy"); },
        oncreate	: function() { log("Create"); },
        ondelete	: function() { log("Delete"); },
        onopen		: function() { log("Open"); },
        onopen_all	: function() { log("Open ALL"); },
        onclose		: function() { log("Close"); },
        error		: function() { },
        ondblclk	: function() { log("Doubleclick"); TREE_OBJ.toggle_branch.call(TREE_OBJ, NODE); TREE_OBJ.select_branch.call(TREE_OBJ, NODE); },
        onrgtclk	: function() { log("Rightclick"); },
        onload		: function() { log("Tree loaded"); },
        onfocus		: function() { log("Tree got focus"); },
        ondrop		: function() { log("Foreign node dropped"); }
      }
    });
});