Is there a way to insert a node (from the server-side) into a RadTreeView that contains HTML? For example ... how do I insert
SomeText<i>some other text</i> and have it show the "some other text" as italic (basically tell the server NOT to HTML encode the string)?
By default it HTML-encodes the Text property.
Thanks!
Jay
SomeText<i>some other text</i> and have it show the "some other text" as italic (basically tell the server NOT to HTML encode the string)?
By default it HTML-encodes the Text property.
Thanks!
Jay
4 Answers, 1 is accepted
0
Jay
Top achievements
Rank 1
answered on 29 Aug 2008, 01:19 AM
Ooops. My bad. This control requires the caller to HTML encode the string .... which is perfect. This way the caller can actually pass HTML tags into the tree.
0
Hi Jay,
Yes, you can encode the string.
Alternatively, you can use Templates.
Greetings,
Veskoni
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Yes, you can encode the string.
Alternatively, you can use Templates.
Greetings,
Veskoni
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jay
Top achievements
Rank 1
answered on 29 Aug 2008, 11:09 PM
Thanks ... the template idea is great.
I do believe I found a bug in the Javascript node.set_text() api.
It looks like you are HTML-Decoding the text that is passed. I do not believe this is what you intended to do with this API. For example, if I call
node.set_text("<b>Test Text</b>")
or
node.set_text("<b>Test Text</b>")
they will both show the text bolded in the treeview.
I believe you should NOT be html-decodeing the string ... just pass it as-is to the tree control. Otherwise the caller must html-encode TWICE any string that should be displayed as text.
The server-side RadTreeNode.Text property works correctly ...
I do believe I found a bug in the Javascript node.set_text() api.
It looks like you are HTML-Decoding the text that is passed. I do not believe this is what you intended to do with this API. For example, if I call
node.set_text("<b>Test Text</b>")
or
node.set_text("<b>Test Text</b>")
they will both show the text bolded in the treeview.
I believe you should NOT be html-decodeing the string ... just pass it as-is to the tree control. Otherwise the caller must html-encode TWICE any string that should be displayed as text.
The server-side RadTreeNode.Text property works correctly ...
0
Hello Jay,
This behavior is by design (we need it when editing a node).
You can use the get_textElement() method of the node and modify its innerHTML property with every string you want. That text will not be encoded/decoded, but will not persist after postback.
Regards,
Veskoni
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
This behavior is by design (we need it when editing a node).
You can use the get_textElement() method of the node and modify its innerHTML property with every string you want. That text will not be encoded/decoded, but will not persist after postback.
Regards,
Veskoni
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.