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 David,
yes that will help!
Thanks;-)
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 Assyst,
You need to have the handler that I provided attached to the data grid's initialize client event.
<ig:WebDataGrid ID="WebDataGrid1" runat="server"> <ClientEvent Initialize="initGrid" /> </ig:WebDataGrid>
Let me know if this doesn't work.
-Dave
Hi Dave,
It got worked, but i got a warning now that
Warning: Unresponsive Script
A script on this page may be busy, or it may have stopped responding. You can stop the script now, open the script in the debugger, or let the script continue.As this problem persists the loading got slow. How can i overcome it?
Thanks,
Assyst.