Hybrid View

  1. #1
    Ext User
    Join Date
    Dec 2008
    Posts
    18
    Vote Rating
    0
    --jack is on a distinguished road

      0  

    Cool Dynamic URL of TreeLoader in ColumnTree

    Dynamic URL of TreeLoader in ColumnTree


    Hi,

    I have a textfield and columntree in a page. I want to construct the url for the TreeLoader based on the userinput in the textfield.

    All the columntree examples I saw sets the loader and its url at the time of creation of the tree.

    How can I dynamically change the loader URL for the columntree?

    Also the tree should load its data only when the user enters a value in the textfield and clicks a button.

    I tried setting
    Code:
    tree.loader.url = <new url>
    in the button's click event and then tried
    Code:
    tree.loader.load(tree.root)
    . But it didn't work.

  2. #2
    Ext User
    Join Date
    Jan 2009
    Posts
    3
    Vote Rating
    0
    Saurabh.Maind is on a distinguished road

      0  

    Default


    I am also having same problem . Can i pass Json object directly to the dataurl

  3. #3
    Sencha User
    Join Date
    May 2009
    Posts
    6
    Vote Rating
    0
    BenJenkin is on a distinguished road

      0  

    Default Same problem

    Same problem



  4. #4
    Ext User
    Join Date
    Feb 2009
    Posts
    14
    Vote Rating
    0
    Datagenn is on a distinguished road

      0  

    Default


    Same problem here..

    The API docs don't show a 'reload' function for the ColumnTree or it's loader.

    I tried a few things without success like:
    Code:
      var urlToLoad = '/admin/get-info.php?cname=' + node.id;
      columnTree.loader = new Ext.tree.TreeLoader({
                    dataUrl: urlToLoad,
                    uiProviders:{
                      'col': Ext.tree.ColumnNodeUI
                    }
      });
    Sean

  5. #5
    Ext User
    Join Date
    Feb 2009
    Posts
    14
    Vote Rating
    0
    Datagenn is on a distinguished road

      0  

    Default


    Ok found the solution...

    The root is an AsyncTreeNode as follows
    Code:
    root: new Ext.tree.AsyncTreeNode({
                text:'Info'
            })
    and the API for AsyncTreeNode contains a 'reload' function that takes a callback function as a parameter.

    This works for me:
    Code:
    columnTree.getRootNode().reload(null);
    Sean

  6. #6
    Ext User
    Join Date
    Dec 2010
    Posts
    3
    Vote Rating
    0
    swetta is on a distinguished road

      0  

    Default


    Quote Originally Posted by Datagenn View Post
    Ok found the solution...

    The root is an AsyncTreeNode as follows
    Code:
    root: new Ext.tree.AsyncTreeNode({
                text:'Info'
            })
    and the API for AsyncTreeNode contains a 'reload' function that takes a callback function as a parameter.

    This works for me:
    Code:
    columnTree.getRootNode().reload(null);
    Sean
    works great! thanx!