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
32
accept rate: 0%

edited 24 Sep '12, 15:12

David's gravatar image

David
4.9k21831


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';
}
link

answered 24 Sep '12, 10:48

Gaudenz's gravatar image

Gaudenz
80.1k1310
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.

link

answered 24 Sep '12, 10:32

cheyo's gravatar image

cheyo
1579
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

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
×10
×6

Asked: 24 Sep '12, 09:29

Seen: 1,819 times

Last updated: 24 Sep '12, 15:12