Home - Forums-.NET - FlyTreeView (ASP.NET) - Client side node initialization

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

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

Client side node initialization
Link Posted: 04-Jan-2007 10:24
Hi, I have nodes all built on server side and have forceinit set to false. Now due to some complex third state of the check box mechanism (if some sub nodes are checked is shows two check marks) I need to iterate through nodes collection to collect nodes that are checked. But since force init is set to false, i need to have a way to initialize nodes of the particular branch, before processing them. How do I do that from java script?
Link Posted: 05-Jan-2007 04:40
There's an internal initialization function that is raised when a branch is expanded.

It is not available as public.
Link Posted: 05-Jan-2007 05:53
I tries node.Expand, node.Collapse but nothing happens.
Link Posted: 05-Jan-2007 07:53
Yes. It doesn't work immediately.
The runtime adds the node.htc behavior to required elements (future nodes).
Then the browser asynchronously starts to bind node.htc to the elements.
So you do not get immediate result when calling expand-collapse.
Link Posted: 08-Jan-2007 04:50
This is a really huge problem for us. Is there any way that this private function coud be made public. Or is there any other way to initialize those nodes. Could I simulate Expand/Collapse from javascript, as if user performed the action?
Link Posted: 08-Jan-2007 13:43
You can call Expand() and Collapse() and then you should create a function that will wait for the node to be initialized by the browser.


So call
node.Expand();
node.Collapse();
// then call
startWaitingForHTCAttach();

function startWaitingForHTCAttach() {
if (! testyournodeforinitializtion) {
    window.setTimeout(100, startWaitingForHTCAttach);
} else {
   // do your job with initialized nodes
}
}

Something like this, I believe.
Link Posted: 09-Jan-2007 04:33
to test it for initialization would it be stIsLoaded property?
Link Posted: 09-Jan-2007 06:16
No, you can just check whether any of methods exist for the element.

Like
nodeElement.Collapse != null