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
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
When the data is high it becomes unresponsive script. In my webdatagrid i have rows upto 50000. So is there any way to overcome it?
Any help in this would be highly appreciated.
Thanks,
Assyst.
That is a lot of data to have all at once on the grid. The browser kind of thinks its frozen b/c it is taking the JS so long to add the title attribute to the cells. What I would suggest is using either paging or virtual scrolling to reduce the amount of data on the client at one time. Then, if need be, you can also use this event handler on the grid's AjaxResponse client event.
Can you demonstrate an example which implemented the virtual scrolling in it? I am looking forward to implement it as unresponsive scripting occurs due to huge data load.
Thanks & Regards,
So as long as you have version 9.2 or later, Virtual Scrolling is part of the WebDataGrid. You just need to turn it on. The default settings should be fine (unless you want more data on the client at a time). You also need to attach to AJAXResponse client event on the grid to be sure the tooltips are drawn after an async postback by virtual scrolling fetching new rows.
<ig:WebDataGrid ID="WebDataGrid1" runat="server" Height="350px" Width="400px" ShowFooter="True"> <ClientEvents Initialize="initGrid" AJAXResponse="initGrid" /> <Behaviors> <ig:VirtualScrolling> </ig:VirtualScrolling> </Behaviors> </ig:WebDataGrid>
Let me know if you have further difficutly.
Hi Dave,
Sorry for the trouble caused. From next time onwards i will open up new posts.
I'll answer this, but in the future, could you kindly open a new forum post for questions not pertaining to the original question of the post. That way if other users have the same question, they can more easily find an answer. You could also try checking our documentation as this can easily be found in the client documentation.
On the client, it is very simple to set the visibility of the filter row.
grid.get_behaviors().get_filtering().set_visibility(val). val should be either $IG.FilteringVisibility.Visible or $IG.FilteringVisibility.Hidden.
Is there any way to achieve the filter disable and enable on button click?
My question is that i want to show the filter row on a button click only and i want to remove the same on other button clicks. By default it have to display:none.
I tried to use document.getElementsByClassName(). But it didn't worked out. So i used document.getElementsById(). But when comes to mozilla and other browsers the width of the cells got shrinked. So it don't make sense. And i used the browser generated id to obtain the class which also is not the proper way. So how could i achieve this?
And that grabs the thing in the basket. Now it's working fine. Thanks.
I have one more question to you. Will clarify it after i worked on it.