dhtmlxGrid:Setting column headers

What do I need to do, for handling special char when setting column headers.

I have the following string

header_val = "

*#{truncated_label}
"

mygrid_#{group.id}.setHeader("#{header_val}");



How can I handle, new line char in tooltip. In above code, if there is a new line char in title text, I get javasript error.



If I set headers from XML (with attributes like align, width,sort…), can I use cdata? How would xml look with style, title, sort,type, width, align attributes and using cdata for text and title?



Thanks in advance!

How can I handle, new line char in tooltip.
Most browser will ignore new lines in tooltip.

>>, if there is a new line char in title text, I get javasript error.
You need to replace them with \n
header_val = "<div style=‘color:red;’ title=’#{label.gsub(/\n/,’\n’)}’>
or output it through HTML
#{label}

header_val = "

*

>>If I set headers from XML (with attributes like align, width,sort…), can I use cdata?
Yes
<![CDATA[
any html content, with new lines or any tags here
]]>

dhtmlx.com/docs/products/docsExp … dhtmlx_xml