1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    31
    Vote Rating
    0
    oxi is on a distinguished road

      0  

    Default Ext.tree: reset Treeloader & render Tree without pageref

    Ext.tree: reset Treeloader & render Tree without pageref


    Does anyone know how to change the Treeloader of a loaded Ext.tree and render a different tree instead using a different TreeLoader without a pagerefresh?

    I only managed to dublicate the tree running init function again:
    Code:
    tree.init();
    I'm using ext-1.0-alpha2.

  2. #2
    Ext Premium Member BernardChhun's Avatar
    Join Date
    Mar 2007
    Location
    Quebec, Canada
    Posts
    831
    Vote Rating
    2
    BernardChhun will become famous soon enough

      0  

    Default Re: Ext.tree: reset Treeloader & render Tree without pag

    Re: Ext.tree: reset Treeloader & render Tree without pag


    Quote Originally Posted by oxi
    Does anyone know how to change the Treeloader of a loaded Ext.tree and render a different tree instead using a different TreeLoader without a pagerefresh?

    I only managed to dublicate the tree running init function again:
    Code:
    tree.init();
    I'm using ext-1.0-alpha2.
    this works like a charm without a page refresh. just call the changeLoader function and replace the loader's url to your url.
    It just sets another loader to the tree and then reloads its root.
    Code:
    initTreePanel : function(){
    			// the TreePanel XHR url call.  
    			this.fileTreeUrl = "xhr.php";
    			// init the TreePanel
    			this.fileTree = new Ext.tree.TreePanel("fileTree", {animate:true, containerScroll: true, rootVisible:true});			
    			// suscribing to the selectionChange event to save the current selected node.
    			this.fileTree.getSelectionModel().on('selectionchange', 
    				function(sm, node){
    					this.currentNode = node;
    				}.createDelegate(this)
    			);
    			// creating the root node
    			var root = new Ext.tree.TreeNode({id: "root", text: "root", leaf: false});
    			// the root becomes an AsyncTreeNode once the loader url is set!
    			if (this.fileTreeUrl != ''){
    				this.fileTree.loader = new Ext.tree.TreeLoader({dataUrl: this.fileTreeUrl});
    				root = new Ext.tree.AsyncTreeNode({id: "root", text: "root", leaf: false});
    			}
    			this.fileTree.setRootNode(root);
    			this.fileTree.render();
    		},
    		
    		changeLoader : function(){
    			this.fileTree.loader = new Ext.tree.TreeLoader({dataUrl: "xhr2.php"});
    			this.fileTree.root.reload();
    		}

  3. #3
    Ext User
    Join Date
    Mar 2007
    Posts
    31
    Vote Rating
    0
    oxi is on a distinguished road

      0  

    Default


    Cool! Thanks a lot for your sample code. I was using this ugly workaround:
    Code:
    document.getElementById('treediv').innerHTML='';
    tree.init('get-nodes2.php');

  4. #4
    Ext User
    Join Date
    Jan 2010
    Posts
    2
    Vote Rating
    0
    skumarb is on a distinguished road

      0  

    Default Tree loader

    Tree loader


    i have problem when am updating the tree am able to get the data from db but am not able to update the tree.
    any help out me .this is the code. on close am calling onCloseProfileDialogfunction.




    /**
    * Auraria(R) Networks
    * Copyright(C) 2007-2008 Auraria Networks, Inc.
    * All Rights Reserved
    *
    */
    Ext.ns('SaveDocumentToDialog');

    SaveDocumentToDialog = Ext.extend(Ext.Window, {


    // override
    initComponent : function() {
    this.viewManager = Seam.Component.getInstance("ViewManager");

    this.formPanel = this.createFormPanel();

    Ext.apply(this, {
    width:450
    ,height:300
    ,layout:"fit"
    ,title : "Save documents to" //this.selectedContext.caller
    ,resizable: false
    ,modal:true
    ,defaultButton: 0
    ,items:this.formPanel
    });

    // finally call the superclasses implementation
    SaveDocumentToDialog.superclass.initComponent.call(this);
    this.addButton(ECA._localeStrObj.ProfileSummary_newButton, function() {
    this.profileDialog = new ProfileDialog.CreateProfileDialog({callerContext:"Others"});
    this.profileDialog.on('close', this.onCloseProfileDialog, this);
    this.profileDialog.show();
    }, this);

    this.addButton(ECA._localeStrObj.CreateProject_okBtn, function() {

    var node = this.searchBrowseTree.getSelectionModel().getSelectedNode();
    var request = new Seam.Remoting.createType("com.digitalreefinc.ws.AddFromDocumentsRequestMessage");
    request.srcDocumentHandleList = this.selections;
    request.setDestViewHandle(node.attributes.viewHandle);
    ECA.viewManager.addFromDocuments(request);
    this.close();
    }, this);


    this.addButton("Cancel", function() {
    this.close();
    }, this);

    },

    onCloseProfileDialog: function() {
    this.loadData(this);
    this.searchBrowseTree.expandPath(this.rootNode);

    },

    createFormPanel: function(){

    this.sysMgmtTreeLoader = new Ext.tree.TreeLoader({
    directFn: this.loadData.createDelegate(this)

    });

    this.searchBrowseTree = new Ext.tree.TreePanel({
    border : false,
    header : false,
    loader : this.sysMgmtTreeLoader,
    flex : 1,
    scope: this,
    rootVisible: false,

    root: {
    id: 'root',
    expanded : true,
    nodeType: 'async',
    text: 'The Root',
    draggable: false
    }
    });
    this.centerPanel = new Ext.Panel({
    width : 300,
    height : 250,
    autoScroll : true,
    region: 'center',
    items : this.searchBrowseTree
    });

    this.westPanel = new Ext.Panel({
    width : 150,
    height : 300,
    region: 'west',
    items : new Ext.form.Label({
    fieldLabel: '<b>' + ECA._localeStrObj.SearchDuplicateDocumentDialog_target + '</b>',
    name : 'target'
    })
    });

    this.mainPanel = new Ext.Panel({
    layout: 'column',
    items : [this.westPanel, this.centerPanel]
    })
    this.searchFormPanel = new Ext.form.FormPanel({
    frame: true,
    layout: 'fit',
    id: 'searchFormPanel',
    items: this.mainPanel
    });

    return this.mainPanel;
    },

    loadData: function(nodeId, loadDelegate) {
    var request = new Seam.Remoting.createType("com.digitalreefinc.eca.GetSaveDocumentToTreeRequestMessage");
    request.setCaseHandle(ECA.projectId);
    Seam.Component.getInstance("CaseManager").getSaveDocumentToTree(request, this.loadDataCB.createDelegate(this, [loadDelegate], true));
    },

    loadDataCB: function(result, junk1, junk2, loadDelegate) {
    var response = Ext.util.JSON.decode(result);
    if (response.error)
    {

    alert('Tree failed: '+response.error);
    }
    else
    {
    loadDelegate(response, { status: 'OK' });
    }
    }
    });

Similar Threads

  1. change treeNodes Icon after tree render??
    By omid in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 15 Dec 2009, 8:32 AM
  2. tree.expandAll produces full tree twice! ?
    By seldon in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 2 Dec 2008, 11:00 AM
  3. "paging" within tree nodes of large tree
    By Carina in forum Ext 1.x: Help & Discussion
    Replies: 6
    Last Post: 4 Sep 2008, 3:21 PM
  4. i need this tree
    By melin in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 14 Mar 2007, 5:44 AM
  5. Tree: Refreshing a node's children or the entire tree?
    By eargang in forum Ext 1.x: Help & Discussion
    Replies: 5
    Last Post: 14 Jan 2007, 8:50 PM

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi