In the javascript code Cell.getTooltip() is used to get a tooltip. Unfortunately first some data have to fetch from the server in an asynchronous way. So the first time getTooltip() is called it will return "Loading ..." . When the data is loaded the tooltip should be updated. It looks like a function mxTooltipHandler.updateTooltipText() is missing.

What is the recommended way in such a situation?

asked 24 Sep '12, 09:29

r%20falke's gravatar image

r falke
accept rate: 0%

edited 24 Sep '12, 15:12

David's gravatar image


You can use the following code (where cell is the cell for which the tooltip was fetched):

if (graph.tooltipHandler.state == graph.view.getState(cell))
  graph.tooltipHandler.div.innerHTML = 'hello';

answered 24 Sep '12, 10:48

Gaudenz's gravatar image

accept rate: 39%

This is similar to what I planned to do. Still I think this should part of the base mxGraph distribution.

(24 Sep '12, 11:18) r falke

try using

graph.getTooltipForCell = function(cell){
    return cell.value.mytooltip ; //this is an example

I used a JSON structure inside cell.value and overwriting this method, every refresh is updated.


answered 24 Sep '12, 10:32

cheyo's gravatar image

accept rate: 33%

What do you mean with "every refresh"?

(24 Sep '12, 11:16) r falke
Your answer
toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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



Asked: 24 Sep '12, 09:29

Seen: 1,819 times

Last updated: 24 Sep '12, 15:12