Created
March 5, 2014 11:35
-
-
Save asuraphel/9365589 to your computer and use it in GitHub Desktop.
JSTree Ajax fetcher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"json_data" : { | |
"ajax" : { | |
// the URL to fetch the data | |
"url" : "/organization/organizationTree", | |
//?orgId=${ orgId ? orgId : ""} | |
// the `data` function is executed in the instance's scope | |
// the parameter is the node being loaded | |
// (may be -1, 0, or undefined when loading the root nodes) | |
"data" : function (n) { | |
// the result is fed to the AJAX request `data` option | |
return { | |
"operation" : "get_children", | |
"id" : n.attr ? n.attr("id").replace("node_","") : 1 | |
}; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment