Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIDNN Tree Client Side Node accessDNN Tree Client Side Node access
Previous
 
Next
New Post
5/16/2008 12:48 AM
 

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 6:58 PM
 

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
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIDNN Tree Client Side Node accessDNN Tree Client Side Node access


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, 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 DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out