I'm following along with the VirtualTree demo and can't seem to find a way to get at the parents of a selection:
tree.getSelection().addListener("change", function(e){
var selection = tree.getSelection();
console.log(selection.getItem(0).getName()); // works just fine to get the name
}
I'm trying to get at the properties "Grandparent" and "Parent" from this JSON store:
{
"name": "root",
"children": [
{
"name": "Grandparent",
"children": [
{
"name": "Parent",
"children": [
{
"name": "Name of my Selected Item",
I've tried this:
tree.getModel().getChildren().getItem(0)
but getting at value X for getItem(X) is not straightforward either.
I'd appreciate any help you can provide on this. Thanks!