Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic html support in text shape. (Read 3405 times)
aortega
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Nov 2nd, 2011
html support in text shape.
Nov 7th, 2011 at 10:07pm
Print Post  
Hi,

I'm working with NetDiagram Trial Version in ClientSideMode="JavaApplet"

I use DiagramView.AllowInplaceEdit = True I would like html support when I write the text.

Is it possible that the text of a shape support html? For example:
shapeNode.setText("Some <span style='color: #ff0000'>text </span>Some <span style='font-weight: bold'>text</span>");

Please help me.

Thanks
Alberto
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: html support in text shape.
Reply #1 - Nov 8th, 2011 at 6:39am
Print Post  
Hi,

It's possible by setting the EnableStyledText property of nodes. There's only a very small subset of html supported, listed in the table here:

http://mindfusion.eu/onlinehelp/netdiagram/index.htm?CC_Text_attributes_and_form...

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


I love YaBB 1G - SP1!

Posts: 14
Joined: Nov 2nd, 2011
Re: html support in text shape.
Reply #2 - Nov 8th, 2011 at 11:35am
Print Post  
Thanks for replay.

When in-place editing is started, a new TextBox control is created over the edited node.

Can I access this TextBox control with jQuery? I see: $('#diagramView').attr('MAYSCRIPT'); is 'true'...
In this way, I could use jQuery to replace the selected text by new text with a tag (for example: "text" by "<u>text</ u>") and my problem would be solved.

Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: html support in text shape.
Reply #3 - Nov 8th, 2011 at 11:53am
Print Post  
That textbox is a Java Swing component and I doubt you can get access to it with JQuery. However the textbox will display formatting tags if they are already present in the text, so you should probably append them to the node's Text when creating nodes on the server side, in addition to setting EnableStyledText.

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


I love YaBB 1G - SP1!

Posts: 14
Joined: Nov 2nd, 2011
Re: html support in text shape.
Reply #4 - Nov 8th, 2011 at 12:27pm
Print Post  
Thanks, I'll do it that way.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: html support in text shape.
Reply #5 - Nov 10th, 2011 at 9:05am
Print Post  
By the way, you could also add a EnterInplaceEditScript handler, and access the edit control from there to do things like appending text, changing selection, etc. This is from an older post:

Code
Select All
<DiagramView ... EnterInplaceEditScript="onStartEdit" />

function onStartEdit(sender, args)
{
    var edit = args.getEditControl();
    edit.setLineWrap(true);
} 



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


I love YaBB 1G - SP1!

Posts: 14
Joined: Nov 2nd, 2011
Re: html support in text shape.
Reply #6 - Nov 10th, 2011 at 9:16am
Print Post  
Thank you very much Stoyo.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint