Hi,
does anybody know how to implement a tooltip for a mouseover?
In one of our columns the text is to long to show, so we show only the first letters. The user should see the whole text when hovering over the cell or row...
Thanks for every idea!
Torsten
Hi Torsten,
If you would like to show a default browser tooltip, that is fairly simple. You just need to set the 'title' attribute of the cells. This can be done in the initialize client side event.
Here is an example handler.
function initGrid(grid, args) { var rows = grid.get_rows(); var rowCount = rows.get_length(); var cellCount = rowCount > 0 ? rows.get_row(0).get_cellCount() : 0; for (var r = 0; r < rowCount; ++r) { var row = rows.get_row(r); for (var c = 0; c < cellCount; ++c) { var cell = row.get_cell(c); var cellEl = row.get_cell(c).get_element(); cellEl.title = cell.get_text(); } } }
Hopefully this accomplishes what you need.
regards,
David Young
HI,
I got tooltip but displaying in as <span class=... id="..." style="text-transform:uppercase"> tooltiptext</span>
David,Thanks for the reply...It works perfect.but what if I don't want the tooltip for a selected column in the grid.How can I achieve it??Thanks.
-AKshay
Can you elaborate some more on this code? I tried to work it out, but not worked? How to make this event fired? Can you provide a sample?
Thanks in advance,
Assyst
Hi David,
yes that will help!
Thanks;-)