These forums are read-only and considered to be an archive. Please use the new Community for future interaction and posts.

Select Initial Folder

Hi,

How do we select the initial folder that is open when the control first loads?  (either in js or server side).

Thanks,
Barry
Barry 6/28/2011 6:28 AM

In JS I can do something like:
 
            var path = "folder";
            var tn =tree.selectNode(0, path);
            var tn = tree.getNode(0, path);
            exploreFolder(tn.getRootValue(), tn.getRelativePath(), false, tn);

But only after the root tree has ajax loaded (which doesn't seem to have an event I can use?)
Also this doesn't work for nested folders.

Ideally I'd like to do something like:
 
            var path = "folder/Sub1/Sub2";
            var tn =tree.selectNode(0, );
            var tn = tree.getNode(0, path);
            exploreFolder(tn.getRootValue(), tn.getRelativePath(), false, tn);

Or even better would be to do it on server side...

Thanks,
Barry
Barry 6/28/2011 7:19 AM
FYI, we provide a better client API in v3.0:
FileUltimate 3.0 RC1 is released
Cem Alacayir 8/1/2011 12:05 PM
That sounds promising.

Is there an ETA for v3.0?  Will it cost extra?

Barry 8/2/2011 5:28 AM
V3 does have a much better client side API.

I have been able to select the initial folder by loading the tree nodes in turn using code similar to this:

      function SelectNode(path) {
            var f = FileManager1;
            var node = f.TreeView.GetNode(0, path);
            node.Expand();
            node.Select();
            if (!node.expanded || path != f.TreeView.selectedNode.GetPath())
                setTimeout("SelectNode_Test('"+path+"')", 500);
        }

But it would be cool to have a node.onExpandComplete or onLoadComplete or similar; to avoid the setTimeout recursion.

Or is there a better way to do this??  Can it be done on server side?

Thanks,
Barry
Barry 8/23/2011 11:32 AM