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  |  

AspDotNetStoreFront
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
WebHostForAsp.net
 


  Sponsors  

Meet Our Sponsors

The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
 


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
1596 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.

 


PointClick.Net DNN Solutions
DotNetNuke Hosting Platform for Business and personal use.
PointClick.Net Hosted Solutions
Advanced Web Portals by Infoscaler
Infoscaler is a California based company that provides advanced Web Portals, E-commerce Sites, Database Applications and Intranet Solutions on the DotNetNuke and Microsoft.NET platforms.
www.infoscaler.com
DotNetNuke® in Sweden
All service of DotNetNuke® in Sweden.
Olsmar Konsult

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