Here is how you create an instance, bind an event and then get the instance.
You can use a few events to do that.
Here is a PHP & mySQL enabled demo. You can use the classes/DB structure included, but those are not thoroughly tested and not officially a part of jstree. In the log window you can also see all function calls as they happen on the instance.