Welcome Guest Search | Active Topics | Sign In | Register

TreeView - Hyperlink to Node Options
Jeff_M
Posted: Friday, January 4, 2008 5:00:53 PM
Rank: Newbie
Groups: Member

Joined: 12/28/2007
Posts: 5
Thanks again for your qucik response on my earlier posts. Everything is working great.

2 Things:

1. How do I tie a hyperlink on a web page other than the one with the treeview, which will open the treeview page and select a specific node based on the hyperlink?

2. A suggestion. When using the EO.Web TreeView Builder to create a new node it would be useful after a new node is created to have TreeView Builder set focus on the new node.text property so that the node text can be quickly changed from "New Tree Node."

I did some comparison shopping before making a decision to go with essentialobjects. The control and especailly your support are excellent.

Thanks
eo_support
Posted: Friday, January 4, 2008 6:20:08 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
Hi Jeff,

Glad you like our controls and thank you very much for your suggestion! It makes perfect sense to automatically focus node.Text after you create the node. We will think about implementing that in our next build.

As for hyper link to a tree node, you would need to use our client side JavaScript interface. You can find the detailed JavaScript interface reference in our help file, below is a brief description of how it works.

First you would need to assign each node an ID (via ItemID property) so that later you can use it to identify which node you would like to "click". You would then use some thing like this:

Code: HTML/ASPX
<a href="javascript:GoToNode('node_id');">select and expand a node</a>


Where GoToNode is a JavaScript function you put in your page:

Code: JavaScript
function GoToNode(itemId)
{
   var nodes = TreeView1.searchItemById(itemId);
   if (nodes.length > 0)
        nodes[0].click();
}


That should get you going.

Thanks
Jeff_M
Posted: Friday, January 4, 2008 9:28:48 PM
Rank: Newbie
Groups: Member

Joined: 12/28/2007
Posts: 5
Can I do this in vb.net code and if so how what would that work?

Again Thanks
eo_support
Posted: Saturday, January 5, 2008 6:32:36 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
This has nothing to do with VB. This is client side JavaScript. Generally there is no need to do such things on the server side because it unnecessarily does a postback. If you really want to, you will need to use a LinkButton instead of a hyper link, you can then handle the LinkButton's click event and select the corresponding TreeNode. You will still need to assign ItemID to each TreeNode. If you populate from database, you can find detailed information about how to do this in the help file under "data binding" section.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.