Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic DiagramItem.setToolTip (Read 2029 times)
Mohammad
YaBB Newbies
*
Offline


Hello everybody :)

Posts: 32
Joined: Oct 2nd, 2009
DiagramItem.setToolTip
Oct 3rd, 2009 at 10:13am
Print Post  
Hi

I want to show InPlaceText of each node in a ToolTip.
Although the text inside the node is multi-line, ToolTip shows the text in one line. I use JavaApplet mode and my javascript code is:

function onNodeTextEdited(sender, args)
{
args.getNode().setToolTip(args.getNode().getText());
}

Is there any solution? Thanks.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DiagramItem.setToolTip
Reply #1 - Oct 3rd, 2009 at 11:06am
Print Post  
Hi,

The Java tooltip control we are using does not honor new-line symbols, but can render html. So you could replace the new-line symbols with <p> and enclose the text within <html> and </html>:

Code
Select All
var text = node.getText();
text = text.replace(/\n/g, "<p>");
text = "<html>" + text + "</html>";
node.setToolTip(text);
 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Mohammad
YaBB Newbies
*
Offline


Hello everybody :)

Posts: 32
Joined: Oct 2nd, 2009
Re: DiagramItem.setToolTip
Reply #2 - Oct 3rd, 2009 at 12:40pm
Print Post  
Thank you Stoyo.
That's  great!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint