Dthmlxtree JSON tooltip issue with special character

Hi
i am using
Dthmlxtree JSONobject to show the tree and we are included tooltip to it.
when special character is added to it .it showing incorrect to the user.
Ex :
{“tooltip”:“U&ISS4: GDF Infrastructure Performance & Availability Method 2-10720-BOU-SMD”,“id”:“0.10720.BOU.8”,“text”:“U&ISS4: GDF Infrastructure Performance & Availability Method 2”}

In this example we are able see the correct text .but tooltip is showing the same mention in JSONobject.

Please guide to correct the things.

Hi
Tooltips are simple html “title” attributes where you can not use html tags. It is possible to use only text here. That is why you do not need to use special characters in tooltip definition:

{“tooltip”:“U&ISS4: GDF Infrastructure Performance Availability Method 2-10720-BOU-SMD”,…}

thanks for reply

it is works for XML tree.so what is the difference between dhtmlxtree xml and JSON for buid the tree.it should work similarly in both places.

Yes, & is special character in xml. Therefore, you should use & to represent “&” in text.

Hi Darya,

“tooltip”:“U&ISS4: GDF Infrastructure Performance Availability Method 2-10720-BOU-SMD”,…

similarly i added tool tip and text with special character for the XML and generate the tree .In this case Tool tip working fine.it able display the special character properly.

So my question is why can`t JSON tree Tool tip is not able handle special characters.

Thanks
Dharma

Hi Dharma,

Title attribute is plain text. You can not add any html in it.
Please try to make an experiment. Create a div on you page and set a title attribute dynamically for it:

document.getElementById(“yourDivId”).title = “U&ISS4: GDF Infrastructure Performance Availability Method 2-10720-BOU-SMD”;

and then

document.getElementById(“yourDivId”).title = “U&SS4: GDF Infrastructure Performance Availability Method 2-10720-BOU-SMD”;

However, in xml you need to use & instead of &.