Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

The best choice for your web site host, email hosting, and domain registration.
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Engage Software - Training Partner for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
SmarterTools
The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  ClientAPI Compo...  DNN Tree Client Side Node access
Previous Previous
 
Next Next
New Post 5/15/2008 9:48 PM
User is offline Scott Stokes
108 posts
www.adverageous.com
9th Ranked


DNN Tree Client Side Node access 

Helloooo,

 

I'm trying to manipulate the DNN tree, which I use in my Access Manager module.
I have some situations where I will know the KEY of a node, as it would be set from server side code:

Dim objNode As DotNetNuke.UI.WebControls.TreeNode
objNode = New DotNetNuke.UI.WebControls.TreeNode(strName)
objNode.Key = strKey
objNode.ToolTip = strName

On the client side I may have a node that I want opened, which has not yet been added to the tree (using PopulateOnDemand).

I was hoping to be able to fire client side DNN tree events to find the root node of the node I want open, and traverse from there; populating unadded nodes as needed, until I get to the node I want opened and selected.

I can get this to work using server-side code, but it requires a full postback.  I know the tree is capable of this using it's own internal callbacks, the question is how to access the root nodes client side.  (This is NOT neccessarily the current-selected-node).

 

 
New Post 5/31/2008 3:58 PM
User is offline Jon Henning
1605 posts
www.codeendeavors.com
5th Ranked










Re: DNN Tree Client Side Node access 

Hopefully this code will lead you in the right direction.

//get a reference to the tree
var tree = dnn.controls.controls['ctl00_ContentPlaceHolder1_MyDNNTree'];
//find xml node using xml DOM lookup
var node = tree.rootNode.findNode('n', 'id', id);
//call tree's expandNode method passing in reference to TreeNode
tree.expandNode(new dnn.controls.DNNTreeNode(node));

One thing I want to caution here is that the new controls will no longer use XML and therefore some of the underlying methods calling the XML DOM will not work when upgraded.  However, the code above will work, as I have spent some time making sure common scenarios will still function.  If you wanted to do it the "new" way, this is what the code would look like.

//use BehaviorID assigned to Find tree
var tree = dnn.controls.find('TreeBehaviorID');
//call findNode passing in only id of node your looking for
var node = tree.rootNode.findNode(id);
//call tree's expandNode method passing in reference to TreeNode
tree.expandNode(new dnn.controls.DNNTreeNode(node));

 

       


 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  ClientAPI Compo...  DNN Tree Client Side Node access
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


DNNMasters - modules, consulting, development
DNNMasters developers are involved in DNN development since DNN 1.0.9 and today we offer a broad range of DNN related products and services including custom development of modules, help with ing third party modules for specific needs, general DNN technical support and administrative services.
www.dnnmasters.com
Cygnusoft Custom Software
Cygnusoft has been providing cutting-edge custom software solutions for 20 years. Cygnusoft is also a leading start-up incubator, helping our partners build successful new businesses.
www.cygnusoft.com
Digicon: DotNetNuke design and development
Digicon is based in Brisbane, Queensland, Australia
digicon.com.au

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP