Home - Forums-.NET - FlyTreeView (ASP.NET) - Is findByValue really recursive?

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

Is findByValue really recursive?
Link Posted: 27-May-2011 01:06
I have such situation:

root
  ----node1
        -----node2

When calling:
root.findByValue(node1Id)
I get result.
However, when calling:
  root.findByValue(node2Id)
I don't.

Is that how it's supposed to be?
Link Posted: 27-May-2011 02:10
It is recursive.
But value != id
Value is what's stored in node.Value property.

You can try the treeview.findAll(predicateFunc). The predicateFunc is called for every node (from recursive find), and added to the resulting collection if you return true from it like.

var findallNodesById = treeview.findAll(function(node) { return node.getID() == 'someid'; } );
Link Posted: 27-May-2011 02:51
Evgeny, I use Value for holding id, so it's not the reason. I even used:

var nodeTo = nodeFrom.find(function (node) { return node.getID() == id || node.getValue() == id; });

and nodeTo is undefined for grandchildren.
Any hint? It works for direct child.
Link Posted: 27-May-2011 03:12
Do you use load-on-demand?
If you expand/collapse all the nodes in the treeview, do you still get undefined.

Also do you get
undefined
, or
null
? The find function should return null if nothing found.
Link Posted: 27-May-2011 03:15
I don't use load-on-demand - everything is loaded already.
Doesn't matter if all nodes are expanded - tried that.
I get undefined.