Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Pop Up Details (Read 3436 times)
dolfandon
Junior Member
**
Offline



Posts: 51
Location: Northern Virginia
Joined: Mar 12th, 2009
Pop Up Details
Jan 11th, 2017 at 7:47pm
Print Post  
Is there an example of how to display a modal popup with information about the double clicked node? I figured out how to get the node information but I can't get a popup to work on a page with the diagram control on it. Thanks.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Online


tech.support

Posts: 3148
Joined: Oct 19th, 2005
Re: Pop Up Details
Reply #1 - Jan 12th, 2017 at 9:39am
Print Post  
You probably need to convert from diagram coordinates to page ones. Try something like this, converting from MeasureUnit to pixels and adding the diagram's canvas offset in page -

Code
Select All
function nodeDoubleClicked(sender, args)
{
        var rect = args.getNode().getBounds();
        var p = sender.docToClient(rect.topLeft());
        var controlPos = $(sender.get_element()).offset();
        $('#win').css('left', p.x + controlPos.left);
        $('#win').css('top', p.y + controlPos.top);
        $('#win').modal('show');
} 



Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
dolfandon
Junior Member
**
Offline



Posts: 51
Location: Northern Virginia
Joined: Mar 12th, 2009
Re: Pop Up Details
Reply #2 - Jan 12th, 2017 at 4:55pm
Print Post  
I'm assuming that thee should be a div with the id on win for this to work. Unfortunately it still didn't work for me. Do you have an example of a pop up on a diagram control?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Online


tech.support

Posts: 3148
Joined: Oct 19th, 2005
Re: Pop Up Details
Reply #3 - Jan 13th, 2017 at 7:52am
Print Post  
You can find an example here, draw a node and double click to see the pop-up aligned with the node -
https://mindfusion.eu/_samples/popup_test.zip
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint