dugarab / jsplumb

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

Changing the id of an element #212

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
There should be a way to change the id of the element endpoints are associated 
with, like a 'setId' function, which changes the element's id and reorganizes 
the jsPlumb internals so the endpoints can be attached to a different element. 

Say you have element an element named A with id 'a' and you want to change the 
element to be named B with id 'b'. Right now it loses the endpoints if you 
change the id of the element using something like elem.attr('id','b'); 
Currently endpoints just remain where they were before the id was changed, even 
if the element (B in my example, which used to be named A) is dragged to a new 
location. 

Original issue reported on code.google.com by scottral...@gmail.com on 29 Feb 2012 at 9:14

GoogleCodeExporter commented 8 years ago

Original comment by simon.po...@gmail.com on 2 Mar 2012 at 3:49

GoogleCodeExporter commented 8 years ago
this is done in 1.3.7 dev now.  i added two methods to the jsPlumb class:

setId(el, newId)

el can be a DOM element, a selector, or a String.

and

setIdChanged(oldId, newId)

which you can use after having changed an id to tell jsPlumb about it. in this 
case both oldId and newId are expected to be strings.

Original comment by simon.po...@gmail.com on 2 Mar 2012 at 5:50

GoogleCodeExporter commented 8 years ago
1.3.7 was released today

Original comment by simon.po...@gmail.com on 4 Mar 2012 at 12:10