How to access a treeView located in iFrame

2 posts, 0 answers
  1. Christian Sommer
    Christian Sommer avatar
    19 posts
    Member since:
    Sep 2009

    Posted 11 Dec 2009 Link to this post

    Hello,

    I want' to put my treeView in an iFrame.

    So I can't work with
    var tree = $find('navTree')

    So I'm trying to implement a function in the iFrame

    function

     

    getTree() {

     

     

         return $find('navTree')

     

    }

    and now I'm trying to access the tree from then parent object like that:

     

    tree = document.getElementById(

    "iFrameTreeview").contentWindow.getTree()

     

     

     

    var nodes = tree.get_Nodes();

    But the broser reports: tree.get_Nodes is not a function

    What should I do to get Access to the tree from the parent-site?

    Thanks for your support.

     

  2. Christian Sommer
    Christian Sommer avatar
    19 posts
    Member since:
    Sep 2009

    Posted 17 Dec 2009 Link to this post

    Hello @all:

    I had to find the solution by my own.

    If you're interested in - here you are:

    This function has to be integratet into the treeView page.

    function

     

    getTree() {

     

     

         var tree = $find('navTree')

     

     

         var nodes = tree.get_allNodes()

     

     

         return nodes[0].get_treeView()

     

    }


    In the parent frame you've to replace
        var tree = $find('navTree')
    with 
        iframeTreeView.getTree()

    where iframeTreeView is the name of the iframe, where the tree is located.

    Regards

    Christian

Back to Top