I was creating my diagram with mxGraph, without using mxEditor. I used the mxConnectionHandler example in the API documentation to initialize edge labels:

\n
mxConnectionHandlerInsertEdge = mxConnectionHandler.prototype.insertEdge;\nmxConnectionHandler.prototype.insertEdge = function(parent, id, value, source, target, style)\n{\n  value = 'Test';\n  return mxConnectionHandlerInsertEdge.apply(this, arguments);\n};\n
\n

This worked fine.

\n

When I changed the code to use mxEditor, the labels stopped appearing. I verified that the function was being called during edge creation, but the cell value ends up being "", not "Test".

\n

Any ideas?

\n

Thanks,

\n

Clark

asked 16 Feb '12, 10:31

Clark%20Rasmussen's gravatar image

Clark Rasmussen
21112
accept rate: 0%


mxEditor overrides mxConnectionHandler.factoryMethod, use graph.connectionHandler.factoryMethod = null to fix this.

link

answered 16 Feb '12, 21:06

Gaudenz's gravatar image

Gaudenz
80.1k1310
accept rate: 39%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×228
×39

Asked: 16 Feb '12, 10:31

Seen: 1,216 times

Last updated: 16 Feb '12, 21:06