The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Navigate IE Treeview from Javascript

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jonathan Crossland

Posts: 630
Nickname: jonathanc
Registered: Feb, 2004

Jonathan Crossland is a software architect for Lucid Ocean Ltd
Navigate IE Treeview from Javascript Posted: Nov 23, 2004 6:22 PM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Jonathan Crossland.
Original Post: Navigate IE Treeview from Javascript
Feed Title: Jonathan Crossland Weblog
Feed URL: http://www.jonathancrossland.com/syndication.axd
Feed Description: Design, Frameworks, Patterns and Idioms
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Jonathan Crossland
Latest Posts From Jonathan Crossland Weblog

Advertisement


I needed to navigate the IE Web Controls Treeview from the browser.
In order to do this I altered the treeview.htc to share its navigateNode method. I am not sure if there is another way, but here is the solution I used.

First you need to edit the treeview.htc found in your inetpub\wwwroot\webctrl_client\1_0 or comparable directory. Add the bolded line below to the list of public interfaces.

  <public:method name="databindTypes" />
    <public:method name="getChildren" />
    //insert the following line
    <public:method name="navigateNode" />
</public:component>

Next, the javascript you require would be along these lines

//Get the treeview object -
//getElementByID will expect the name of your treeview

TreeView = document.getElementById('TheFullName_TreeView1');

//Get the Node you require by using getTreeNode
//selectedNodeIndex get/sets the index as dot notation
//In the behaviour you will see the explanation as
//         A
//     / | \
//     B C D
//     / \ / \
//    E F G H
// node F is 0.0.1, node G is 0.2.0, and H is 0.2.1.

var node = TreeView.getTreeNode(TreeView.selectedNodeIndex);

if (node!=null)
{
    //Navigate using our new public method
    TreeView.navigateNode(node);
}


Read: Navigate IE Treeview from Javascript

Topic: The best damn books ever Previous Topic   Next Topic Topic: Software patents

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use