Results 1 to 2 of 2

Thread: What's better than TreePanel/TreeLoader for large directory browsing?

  1. #1
    Ext User
    Join Date
    Nov 2007
    Location
    Cleveland, Ohio
    Posts
    11
    Vote Rating
    0
      0  

    Default What's better than TreePanel/TreeLoader for large directory browsing?

    What's better than TreePanel/TreeLoader for browsing of directories with large numbers of files in them? Currently until I can find a solution, I just have a hack of a link that will get them to windows explorer that works only in IE, not FireFox.

    My tree worked great until they started using the application and put in thousands of files to browse.

    My currently deployed site is choking on large directories causing the animated gif to stop spinning and the browser to seem to lock up for 30 to 60 seconds while it adds the thousands of nodes for the files in that directory

    Code:
    <div id="tree-div" style="height:575px;width:250px;"></div>
    <script type="text/javascript">	
    Ext.onReady(function() {	
        // shorthand
        var Tree = Ext.tree;
        
        var tree = new Tree.TreePanel({
        	el:'tree-div',
            animate:false, 
            loader: new Tree.TreeLoader({dataUrl:'http://www.mysite.com/get-nodes.cfm'}),
            enableDD:true,
            containerScroll: true,
    	autoScroll: true,
    	singleExpand:true
    	});
        tree.addListener('beforeclick', function(node, e) {
        		if (node.isLeaf())
    		{
    		    document.location = 'file://www.mysite.com'+node.id.replace(/:/g,"/");
    		}
    		else
    		{
    		    node.expand();
    		}
        });
    
        // set the root node
        var root = new Tree.AsyncTreeNode({
            text: 'myRoot',
            draggable:false,
            id:':'
        });
        tree.setRootNode(root);	
        
        // render the tree
        tree.render();
        tree.expandPath('/:');
    });
    </script>
    get-nodes.cfm
    <cfloop index="i" from="1" to="#treeQuery.RecordCount#">
    {"text":"#treeQuery.name[i]#",
    "id": "#treeQuery.directory[i]#<cfif "#treeQuery.directory[i]#" NEQ ":">:</cfif>#treeQuery.name[i]#",
    
    "cls":"folder"
    <cfif "#treeQuery.type[i]#" EQ "file">,"leaf":true</cfif>
    }
    <cfif "#i#" NEQ "#treeQuery.RecordCount#">,</cfif>
    </cfloop>

  2. #2
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664
    Vote Rating
    404
      0  

    Default

    Hmmm, there is nothing out-of-the-box but I could think about an equivalent of paging. Let's say your server would return only n files and n+1 node saying "More...", or "Next n files..." Clicking on that would load next n files.

    Just an off hand idea...
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •