This is a migrated thread and some comments may be shown as answers.

Question about onHover

2 Answers 76 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Luke Kasper
Top achievements
Rank 1
Luke Kasper asked on 13 Oct 2010, 01:28 PM
Hello,

I'm having trouble getting the onhover events to work the way I want and I was hoping someone could help.  Right now, I have javascript wired up to the OnRowMouseOver event for my grid, but I'm having issues finding out which particular cell the mouse is over to display the text I need to display.  For instance, my OnRowMouseOver event calls a function changeRow(srcRow,e).  The first two lines of changeRow are this:

var node = $find(e.get_id());

node = node.get_element();


Now, my node variable has the row record, but I have no clue what cell the pointer was over.  I have a function set up where all I have to do is pass it the text that I want to display in the hover text and it'll do the legwork, but I can't figure out what text to send along because I don't know what cell is being hovered over.

I've looked and looked, but I can't find anything listed that will help with this.  Also, I'd like to avoid using an onmouseover event for EVERY cell in the grid because the number of cells possible for this implementation is in the thousands, and it'll really hit our performance I fear.  As a kinda "gotcha", this function used to work with the ASP.NET RadControls, but now that I'm trying to upgrade to ASP.NET AJAX RadControls, it doesn't work anymore.

Can anyone help me with this?  I feel like it'll be something easy that I'm overlooking, but for the life of me I can't figure out what it is.

Thank you!

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 13 Oct 2010, 02:06 PM
Hello Luke,

This is what you need:


<telerik:RadGrid>
    <ClientSettings>
        <ClientEvents OnRowMouseOver="MyRowMouseOver" />
    </ClientSettings>
</telerik:RadGrid>
 
<script type="text/javascript">
 
function MyRowMouseOver(sender, args)
{
    var cell = args.get_domEvent().target;
}
 
</script>


Regards,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Luke Kasper
Top achievements
Rank 1
answered on 18 Oct 2010, 02:42 PM
Thank you!  That answered my question, although it leads to another question, which I'll raise in another thread.
Tags
Grid
Asked by
Luke Kasper
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Luke Kasper
Top achievements
Rank 1
Share this question
or