Hi,

\n

I am trying to make a cell invisible when a user clicks on it. I have modified the code in overlays.html as follows :

\n
 graph.addListener(mxEvent.CLICK, function(sender, evt)\n            {\n                var cell = evt.getProperty('cell');\n                console.log(cell.getValue());\n                console.log(cell.getId());\n                if (cell != null)\n                {\n                    cell.setVisible(false);\n                }\n            });\n
\n

But, it is not working. The cell is still visible. What am I doing wrong?

\n

Thanks in advance.

asked 06 Feb, 19:05

punithsn's gravatar image

punithsn
282
accept rate: 25%


Use the model, ie. graph.getModel().setVisible(cell, false) for the repaint to work.

link

answered 06 Feb, 22:07

Gaudenz's gravatar image

Gaudenz ♦♦
7.4k15
accept rate: 31%

Thanks Gaudenz.

(06 Feb, 22:24) punithsn
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:

×313
×65
×30
×13
×6

Asked: 06 Feb, 19:05

Seen: 194 times

Last updated: 06 Feb, 22:24

powered by BitNami OSQA