dugarab / jsplumb

Automatically exported from code.google.com/p/jsplumb
0 stars 0 forks source link

Endpoint max connections callback #261

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Enhancement: Provide a specific callback if a user attempts to create a 
connection with an endpoint that has already reached it maximum number of 
connections allowed. 

Original issue reported on code.google.com by scottral...@gmail.com on 10 Jul 2012 at 8:25

GoogleCodeExporter commented 8 years ago
this is in development now, to be released with the next version (be that 1.4.0 
or 1.3.11, not sure yet)

there are two ways you can register for the event - in an Endpoint definition:

var endpoint = {
  endpoint:"Dot",
  onMaxConnections:function(info, evt) {
    ...
  }
};

...or with a "bind" like you bind for other events:

var ep = jsPlumb.addEndpoint("someDiv", ...);
ep.bind("maxConnections", function(info, evt) {
  // here you have info.endpoint and info.connection
});

Original comment by simon.po...@gmail.com on 18 Jul 2012 at 11:06

GoogleCodeExporter commented 8 years ago
...the callback actually gets three items in the JS literal:

{ 
  maxConnections
  endpoint
  connection
}

Original comment by simon.po...@gmail.com on 19 Jul 2012 at 7:51

GoogleCodeExporter commented 8 years ago

Original comment by simon.po...@gmail.com on 21 Jul 2012 at 7:05

GoogleCodeExporter commented 8 years ago

Original comment by simon.po...@gmail.com on 29 Jul 2012 at 5:24