Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Paxton Scott on Apr 23, 2008 09:46
open dhtmlx forum
Mouseover on headings -- More

Your answer: There is no such built in functionality, but you can place any HTML inside grid header, and use title attribute from it

grid.setHeader("A,<span title=' custom tooltip text here '>B</span>,C")

Is Great! Thanks.

But, in extending this, I discovered that your parser of the headings uses the comma ( , ) ignoring the possibility that it is contained within a set of quotes.

So, this will not work:
    grid.setHeader("A,<span title=' custom, tooltip text here '>B</span>,C")

I got fancier, and embedded an onmouseover event and called a function.
var     status_text = '"Status V=Verified. X=You say you own but not yet verified. S=Send in now! you have traded this item away. R=Receive. You have bought (or traded for) and are awaiting the seller (trader) to verify. W=Item on your Wish list."';

grid.setHeader("A,<span onmouseover='ddrivetip("+status_text+");' onMouseout='hideddrivetip()' >B</span>,C")

Here, ddrivetip can accept 3 parameters, the text to display, the width of the box and the background color. But, since your parser must use the comma, can not have additional parameters. (unless embedded in one and parsed in the function). Still, great answer and I can accomplish my goals. Thank you!!

Answer posted by Support on Apr 24, 2008 04:14
>>But, since your parser must use the comma, can not have additional parameters
There is a workaround, you can use commas in header if they are escaped as
    grid.setHeader("A,<span onmouseover='ddrivetip("+status_text+"\\,paramB\\,paramC);' onMouseout='hideddrivetip()' >B</span>,C")