community-edition icon indicating copy to clipboard operation
community-edition copied to clipboard

Repaint method shows error

Open EugenePisotsky opened this issue 7 years ago • 5 comments

Problem: when i'm trying to repaint an element like that:

this.instance.repaint(element, { left: data.x, top: data.y });

I see the following error:

TypeError: undefined is not an object (evaluating 'managedElements[elId].el')

But everything works fine, if source and target have the connection. But if they aren't connected, but initialized as source and target, i see that error. Is this a bug? Or there is another way to repaint non-connected sources and targets?

EugenePisotsky avatar Apr 01 '17 20:04 EugenePisotsky

If i call repaint without the second argument, error is not showing

EugenePisotsky avatar Apr 01 '17 21:04 EugenePisotsky

this is with the community edition? where did you get the impression that you could pass a new location to the repaint method?

sporritt avatar Apr 01 '17 23:04 sporritt

yes, it's a community edition. i followed the documentation: https://jsplumbtoolkit.com/community/doc/utilities.html

here's my class which manages jsPlumb instance. I wrote a comment on the 58 line where problem causes if it will be useful: https://gist.github.com/RevanScript/1f11eacbc12f5af07e75262f9dd9596a

EugenePisotsky avatar Apr 01 '17 23:04 EugenePisotsky

yeah right, from the docs! i didnt know anyone bothered to read the documentation these days. how encouraging. i'll mark this as a defect then and take a look in the next couple of days.

sporritt avatar Apr 01 '17 23:04 sporritt

thanks a lot! :)

EugenePisotsky avatar Apr 01 '17 23:04 EugenePisotsky