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 ForumsClientAPIClientAPICapture Click event of expand-collapse image at client-sideCapture Click event of expand-collapse image at client-side
Previous
 
Next
New Post
8/8/2006 3:24 AM
 

Hi,

I need to capture click event of expand-collapse image at client side. When a click on expand-collapse image happens it collapses and expands a node. I need to add an additional functionality apart from its default functionality.

Thanks,
Vishwanath

 
New Post
8/8/2006 1:46 PM
 

I will be adding functionality to all the controls that allow for easier development of client-side events in the future.  I just don't have the cycles to do so right now.  However, I can offer you this script to allow you to accomplish your goal.

	initTree();
	function initTree()
	{
		var oTree = dnn.controls.controls['MyDNNTree'];
		for (var i=0; i<oTree.rootNode.childNodeCount(); i++)
			attachHandler(oTree.rootNode.childNodes(i), oTree);
	}
	
	function attachHandler(oNode, oTree)
	{
		var oTNode = new dnn.controls.DNNTreeNode(oNode);
		var oImg = oTree.getChildControl(oTNode.id, 'expcol');
		if (oImg != null)
		{
			dnn.dom.attachEvent(oImg, 'onclick', expandCollapse);
			for (var i=0; i<oTNode.node.childNodeCount(); i++)
				attachHandler(oTNode.node.childNodes(i), oTree);
		}
	}
	
	function expandCollapse()
	{
		var oImg = dnn.dom.event.srcElement;
		var oTree = dnn.controls.controls['MyDNNTree'];
		var oNode = oTree.DOM.findNode('n', 'id', oImg.nodeid);
		var oTNode = new dnn.controls.DNNTreeNode(oNode);
		alert(oTNode.id);
		return true;
	}

Please note that this is much more complicated (i.e. more code) than I intend it to be.  I would look at this as a temporary workaround until I provide you a cleaner way to accomplish the same thing.  This script also assumes that when the initTree method is called all nodes that need to sync the event are present (i.e. no POD)...   you can modify the script as needed if you require POD.  I would probably use the status function capability to attach the events to the newly retrieved nodes.


 
New Post
8/21/2006 1:31 PM
 

Hi Jon,

Thanks you very much for this reply. I am sorry for late reply. Using this code I have successfully captured the click event of the expand-collpase image.

Also, this code has given me idea regarding how to use the DNNClient APIs.

Thanks,
Vishwanath Patel

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPICapture Click event of expand-collapse image at client-sideCapture Click event of expand-collapse image at client-side


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