The solution was for FlyTreeView for ASP.NET 1.1 wich has different client-side model.
Here's the solution for FlyTreeView for ASP.NET 2.0:
function onNodeEventHandler(treeview, node, eventType){
if (eventType == \"collapsed\") {
var childNodes = node.getChildNodes();
for(var i = 0; i < childNodes.length; i++){
var curChild = childNodes[i];
curChild.remove();
}
node.setPopulateNodesOnDemand(true);
}
}
And the hanlder for FlyTreeView tag:
OnNodeEventJavascript=\"onNodeEventHandler\"
P.S. The latest build of FlyTreeView for ASP.NET 2.0 required (build 145)