Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic DiagramBase.Clicked Event? (Read 2480 times)
developer
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 5
Joined: Apr 9th, 2013
DiagramBase.Clicked Event?
Apr 15th, 2013 at 4:08pm
Print Post  
Hi,

I'm testing diagram controls to asp.net mvc and I can not launch the Clicked event of the diagram. The code is as follows:

DiagramView view = (Request.Form["diagramView1_PostData"] == null) ? new DiagramView() : DiagramView.FromJson(Request.Form["diagramView1_PostData"]);
Diagram diagram = view.Diagram;

diagram.Clicked += diagram_Clicked;

void diagram_Clicked(object sender, DiagramEventArgs e)
{

}

Can someone help me?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DiagramBase.Clicked Event?
Reply #1 - Apr 15th, 2013 at 5:22pm
Print Post  
Hi,

The events from the Diagram class are used only in the Windows Forms version of the control, which uses the same diagramming.dll assembly. In the ASP.NET MVC version, you can handle events only on the client side by setting NodeClickedScript to the name of a JavaScript function that should be called upon click, or by attaching a handler by calling diagram.addEventListener(Event.nodeClicked, function) on the client side:

Code
Select All
diagram.addEventListener(Events.nodeClicked, onNodeClicked);

function onNodeClicked(sender, args)
{
    alert(args.getNode().getText());
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint