If anyone was wondering how to do this, I made some progress. Currently it has an event for every node if it is selected, it checks if the 2nd attribute (just so happened to be 2nd) has the phrase "room_" in it. It's probably not the best way to do it but it's the best I could come with. Here's what I have:
- $(".sidecontent").jstree(data.tree).bind("select_node.jstree", function(e, data) {
- //nodeId is the value I picked to check if the node had an id
- var nodeId = String(data.rslt.obj.context.attributes[1].nodeValue);
- if (nodeId.match(/room_\d/g) == null) {
- //code when node has an id
- } else {
- //code when node doen't have an id
- }
- });
It looks rough but I don't know a better way to do it.. I'll gladly take suggestions. It seems inefficient...
Thanks,
Trumpetmcool