Welcome Guest Search | Active Topics | Sign In | Register

Grid with tooltips Options
Ronald
Posted: Monday, August 26, 2013 11:42:31 AM
Rank: Member
Groups: Member

Joined: 8/21/2008
Posts: 24
Dear Support,

I’m looking for a possibility to show a tooltip (or something similar), if the user moves the mouse over a cell of the Grid. I’ve looked at your example, but this will not work, because I need to create the tooltips on the server side.
What I like to do is to show a calendar (which means, I have 365 cells) and show inside of the calendar, if someone is in or out of office. If the user move with the mouse over the cells, I like to show the reason for the absence, which does not fit into the cell. So I cannot use the javascript “getValue” function.
My question is, is it possible, to give to the “toolTip.setBodyHtml(cellText)” for cellText an String item generated at the server or is there any other possible way? And can I use the Grid for this purpose at all?

Thank you for your help!
eo_support
Posted: Monday, August 26, 2013 5:26:40 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

No. You won't be able to do it that way. The Grid does not have built-in support for tooltips. However there are a few ways to implement the tooltip. One way is to set the Grid Cell's value to raw HTML with "title" attribute. For example, instead of setting the Grid cell value to "123", you can set it to "<div title='this is a tooltip'>123</div>". You can do this easily on the server side by only changing the data you pass to the Grid. Alternatively, you can also use a CustomColumn, and handle the column's ClientSideGetText to format such an HTML string based on your value. If you do it this way, you will have to render some JavaScript that will build a table of all the tooltip values for each cell, so that inside your ClientSideGetText you can look up this table and use the correct tooltip string in the final HTML.

Hope this helps.

Thanks
Ronald
Posted: Tuesday, August 27, 2013 4:58:52 AM
Rank: Member
Groups: Member

Joined: 8/21/2008
Posts: 24
Perfect!

Thank you very much!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.