Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by SFGolfer on Apr 23, 2009 16:34
open dhtmlx forum
Dynamic title in custom link

I am setting up a custom hyperlink via an XML feed and would like to use a custom title.

This works...

print("<cell title='customtitle'>");
print("<![CDATA[<a href='details.php?id=".$row['id']."'>Details</a>]]>");
print("</cell>");


This does not work...

print("<cell title='<![CDATA[".$row['client_name']."]]>'>");
print("<![CDATA[<a href='details.php?id=".$row['id']."'>Details</a>]]>");
print("</cell>");

I'd like to use the client_name field to be the Title. I'm attempting to use CDATA because some names may contain the ampersand sign.

Answer posted by Support on Apr 24, 2009 04:06
XML allow usage of CDATA only for tags, it can't be used in attributes.

There are 3 possible solution

a) replace & with &amp; in client_name field, in such case you will not need to use CDATA
b) switch to native HTML tooltips
in js code 
      grid.attachEvent("onMouseOver",function(){ return false; })
in XML 
print("<cell>"); 
print("<![CDATA[<a href='details.php?id=".$row['id']."' title='".$row['client_name']."'>Details</a>]]>"); 
print("</cell>");

c) use userdata to store necessary data and set title dynamically on client side

Answer posted by SFGolfer on Apr 24, 2009 05:00
Thank you.  I went with option B.