:: Forum >>

getting all folder parents of selected child node

Is it possible to get all folder parents of selected child node
using the tree widget?

This is a must have... version 2.0.1

please help.
Gal L.
Thursday, August 10, 2006
To be able finding the parent of the current node you have to add a new property to the tree view model which contains child-parent relationship (inverse to the view indices array). This is likely to be the standard part of tree API in the future but the current version does not have it, so you have to define it with defineViewProperty() method.

var treeText = ["", "Home", "Favorites", "Font size", "Search", "Child node 1", "Child node 2"];
var treeImage = ["", "home", "favorites", "fontsize", "search"];

// child nodes
var treeView = {0:[1, 2, 3, 4], 1:[5, 6], 2:[7], 3:[8], 4:[9]};

// parent node
var treeParent = {1:0, 2:0, 3:0, 4:0, 5:1, 6:1, 7:2, 8:3, 9:4};

var tree = new AW.UI.Tree;
tree.setViewCount(function(i){return treeView[i] ? treeView[i].length : 0});
tree.setViewIndices(function(i){return treeView[i]});

// add 'parent' property to the 'view' model

tree.setViewParent(function(i){return treeParent[i]});


tree.onItemClicked = function(event, i){
Alex (ActiveWidgets)
Thursday, August 10, 2006
This is a good example and has given me several pointers, but to save me wasting too much time 'discovering' the functionality or not some basic interface details would be useful ie methods, properties and events. the rest we can make a stab at working out for ourselves.
The value to me in buying a suite of components is the time saving over developing them ourselves. If we will have to spend too much time finding our way around it defeats the object.

Please, Please ...
Tim Edwards
Tuesday, January 2, 2007

This topic is archived.

Back to support forum

Forum search