Thank you, Iβve lost my mind. None of the old examples work! So, I finally can access the metadata, the problem is that I do not know how to iterate over an unknown number of metadata fields?
ok, now I checked it and you can iterate over the object returned by data () without named parameters
.bind("select_node.jstree", function (e, data) { var propsObj = $(data.rslt.obj).data(); for (var prop in propsObj) { alert(prop + " = " + propsObj[prop] + "\n"); } });
If you need to avoid creating the jstree_children array, the best way, in my opinion, is to encapsulate metadata in another object:
"metadata" : {"properties" : {"prop1" : "aa1a", "prop2" : "123"}}
you can iterate with:
var metadata = $(data.rslt.obj).data(); for (var prop in metadata.properties) {...}
Maciej zabielski
source share