[CLOSED] TreePanel using PageProxy: expand a path via javascript

  1. #1

    [CLOSED] TreePanel using PageProxy: expand a path via javascript

    Hi,

    I started from the "TreePanel using PageProxy" example.
    I would like to expand a path, via javascript (consequently to a button click).

    I tried this:

       function onFind(id) {
           var path = ... // something like "/Root/1/3/123/98993"
           App.STree.expandPath(path);
      }
    but I get no effect
    Last edited by Daniil; Apr 08, 2013 at 7:49 AM. Reason: [CLOSED]
  2. #2
    Hi @sbg,

    What does the getPath call on the node that you want to expand return?

    Just to ensure everything is OK with the path.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @sbg,

    What does the getPath call on the node that you want to expand return?

    Just to ensure everything is OK with the path.
    Hello, I tried this javascript code on the "TreePanel using PageProxy" example:
    function onFind() {
           var path = "/Root/0/01/011/0111/01111";
           App.TreePanel1.expandPath(path);
    }
    and it does not work.
    Which is the correct way to get a remote loaded treepanel to be expanded up to a certain node?

    Thank you
    Last edited by sbg; Apr 08, 2013 at 7:15 AM.
  4. #4
    Quote Originally Posted by Daniil View Post
    What does the getPath call on the node that you want to expand return?

    Just to ensure everything is OK with the path.
    The root node has NodeID="0", so the getPath returns "/0".

    So, the following appears to be working as expected.

    var path = "/0/01/011/0111/01111";
    
    App.TreePanel1.expandPath(path);
  5. #5
    Quote Originally Posted by Daniil View Post
    The root node has NodeID="0", so the getPath returns "/0".

    So, the following appears to be working as expected.

    var path = "/0/01/011/0111/01111";
    
    App.TreePanel1.expandPath(path);
    It works like a charm!
    Thank you so much, Daniil

Similar Threads

  1. Replies: 5
    Last Post: Jul 15, 2019, 9:12 AM
  2. TreePanel expand node behaviour
    By web4u in forum 2.x Help
    Replies: 1
    Last Post: Aug 28, 2012, 1:02 PM
  3. [CLOSED] Treepanel expand path
    By HOWARDJ in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: Mar 31, 2010, 10:41 AM
  4. Expand Panel with Javascript?
    By simonmicheal in forum 1.x Help
    Replies: 1
    Last Post: Oct 06, 2009, 12:27 PM
  5. TreePanel node expand button IE8
    By methode in forum 1.x Help
    Replies: 8
    Last Post: Sep 08, 2009, 4:00 AM

Tags for this Thread

Posting Permissions