Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Event (Read 3892 times)
Tima
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 25
Joined: Nov 10th, 2010
Event
Aug 27th, 2011 at 9:17am
Print Post  
Unable to add Diagramlistener , how can i know the name or tagname of node in which click event occurs;

And
there is not any method to set behaviour of digram as in java swing.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Event
Reply #1 - Aug 27th, 2011 at 10:03am
Print Post  
Adding an event listener should look like this:

// a shortcut to the Events class
var Events = MindFusion.Diagramming.Events;

// add the listener
diagram.addEventListener(Events.nodeCreated, onNodeCreated);

The current version supports only a small subset of the events available in the desktop controls:
http://www.mindfusion.eu/onlinehelp/jsdiagram/index.htm?T_MindFusion_Diagramming...

There aren't any official Tag or Name properties, but since JavaScript objects are implemented as hashtables, you can add whatever fields you need just by assigning to them:

node.tag = "my tag"; // adds a tag field

or

node["tag"] = "my tag";

Currently there's only the LinkShapes behavior implemented internally. If you need something like DoNothing or Modify, we can add it next week.

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