I need some advice or examples to help me make some progress on my project.
What I want to do is create a top-level node without children, but it does have an arrow for opening the node. When the user opens this node, the app would use Ajax to find the children of this node. This arrangement would continue with all the children, depending on their type.
I thought that by specifying an opened state of false for my top-level node, that would cause it to show the arrow. Of course, it doesn't. Later, I found that by specifying a value of true for the children attribute when I create the node, I could cause the arrow to appear:
myTree.create_node('#', {
id: '123456789',
text: 'root',
children: true
});
However, that arrow doesn't respond to clicks, so the node can't be opened. Also, trying to use create_node() to make a child of that node silently fails. Specifying false children like this seems to be a Bad Thing.
How can I create a node without children, but it's openable, and the app would be able to catch open_node.jstree events in order to load children?