Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Popup window on node click (Read 2730 times)
sm
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Oct 8th, 2008
Popup window on node click
Jul 16th, 2009 at 10:37am
Print Post  
Hi,

I'm using the imagemap mode of netdiagram. I need a popup window to appear whenever i click on a node and need the popup to disappear if i click on an empty area. Is this behaviour possible? I couldnt find an event which is fired when i click on an area which does not have a node.

Please do let me know how this can be done.

Thanks
sm
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Popup window on node click
Reply #1 - Jul 16th, 2009 at 12:07pm
Print Post  
Hi,

There is no built-in event raised in that case. You might add a handler to the onclick event of the DIV rendered by DiagramView. The DIV's id is the same as DiagramView.ClientID. In the handler check if the target element is an AREA or an IMG. If it's an IMG, the click was on an empty area. E.g. if you are using Ajax for ASP.NET for client side scripting:

Code
Select All
// in the onload handler
$addHandler(diagViewDiv, "click", onClick);

// in onClick
if (e.target.nodeName == 'IMG')
	hidePopup();
 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
sm
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Oct 8th, 2008
Re: Popup window on node click
Reply #2 - Jul 17th, 2009 at 9:09am
Print Post  
Hi,

I tried adding an event handler to the onClick event, but it throws a compile-time error that the diagramView does not have a onClick event. Since the div tag is created only dynamically , how do i do this?Should i be using delegates? I'm not using Ajax.

Thanks for helping
-sm
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Popup window on node click
Reply #3 - Jul 17th, 2009 at 1:16pm
Print Post  
Hi,

What do you mean by compilation error, are you trying to add an event handler on the server side? You must handle the DIV's event on the client side using JavaScript.

Stoyan
  
Back to top
 
IP Logged
 
sm
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Oct 8th, 2008
Re: Popup window on node click
Reply #4 - Jul 20th, 2009 at 11:37am
Print Post  
Thanks a lot!

I got it working.Smiley

-sm
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint