Results 1 to 7 of 7

Thread: Is there an event for all children rendered in AsyncTreeNode?

  1. #1

    Default Is there an event for all children rendered in AsyncTreeNode?

    Hi,

    I have a page with radio button group on the top and a TreePanel below it. Upon selectionchange of the radio button group, I reload the rootNode (which is an AsyncRootNode) with a different id.

    Code:
    tree.getRootNode().id = newID;
    tree.getRootNode().reload();
    The problem is that when the user changes selection quickly I get an error:"this.getOwnerTree() is null or not an object".

    Ideally I would like to reload the TreeNode once the current loading and rendering is complete, but I couldn't get it to work. So what I am doing is disabling the radio button group upon selectionchange and would like to enable it when all the children and grandchildren of the rootNode have been loaded and rendered. The 'load' event of AsyncTreeNode does not work if the children have children.

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    1st param to reload.

  3. #3

    Default

    Thanks Animal for the quick reply. I'm really sorry I don't understand what you mean by "1st param to reload." I'm new to Ext JS, so please bear with me.

    Thanks

  4. #4
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    You call reload there.

    What do the docs say?

  5. #5

    Default

    Ok, I get that now.
    Code:
    tree.getRootNode.reload(function(){ // enable radio button group});
    However, the call back function never gets executed when the root node has great grand child nodes(depth = 3) and the radio buttons are enabled before the entire tree is rendered, which allows user to make another selection while the tree is in the midst of rendering, causing "this.getOwnerTree() is null or not an object" error to appear. Is there a way to call a function once the entire AsyncTreeNode ( the Entire tree (all the childrens)) is done rendering?

    Thanks

  6. #6

    Default

    Is there a way to call a function once the entire AsyncTreeNode ( the Entire tree (all the childrens)) is done rendering?
    Code:
    tree.on('afterrender', fn);
    Wes

  7. #7
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    That's not right. Component rendering is different.

    I don't understand the OP's problem.

Similar Threads

  1. Replies: 2
    Last Post: 26 Jun 2009, 5:33 PM
  2. AsyncTreeNode leaf false expanded true and children is empty array
    By emredagli in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 21 Jun 2009, 10:19 PM
  3. how to get AsyncTreeNode to go get children everytime
    By ShaneB in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 19 Sep 2008, 7:41 AM
  4. Replies: 0
    Last Post: 18 Oct 2007, 6:07 AM
  5. Tree with children rendered, but not accessible...
    By francescoNemesi in forum Ext 1.x: Help & Discussion
    Replies: 4
    Last Post: 22 Aug 2007, 4:56 AM

Tags for this Thread

Posting Permissions

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