Determining which element lanched the tooltip?

4 posts, 0 answers
  1. Brian Roth
    Brian Roth avatar
    136 posts
    Member since:
    Oct 2005

    Posted 06 Mar 2013 Link to this post

    I'm playing around with the new tooltip and so far so good!  I've run into one problem though, which might just be because the documentation has not been published yet.  I have a situation where I am showing a tooltip when the user hovers over a grid cell.  In the tooltip I have a button where if the user clicks that button I want to do something to the data in the grid for the selected row.  My plan was to bind the click event of the button from inside the tooltip's ContentLoad event .  But I can't figure out in ContentLoad if there's a way to determine what element caused the tooltip to display.  Is there a way to do this?  I'd like to be able to get the <td> of the grid cell, and traverse that up to the <tr> so that I can use that to retrieve the grid's data item.

    Thanks,
    Brian
  2. Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 07 Mar 2013 Link to this post

    Hi Brian,

    You may configure the content as a function in order to build the Tooltip content and to attach the click handler. Here is a test page which illustrates a basic implementation.

    Greetings,
    Rosen
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Brian Roth
    Brian Roth avatar
    136 posts
    Member since:
    Oct 2005

    Posted 07 Mar 2013 Link to this post

    Hi Rosen,

    Thanks for the advice.  I'm actually using the MVC wrapper Tooltip with a LoadContentFrom to get my content from another view.  How would this approach work in that situation?  Or would I need to take another approach?

    Brian
  5. Brian Roth
    Brian Roth avatar
    136 posts
    Member since:
    Oct 2005

    Posted 07 Mar 2013 Link to this post

    Never mind.  I figured out another way to do it.  In the RequestStart event, I save the value of e.target to a global variable and then in the ContentLoad event I access that variable and set up the click event.  Seems to be working just dandy now.  Thanks!

    Brian
Back to Top
Kendo UI is VS 2017 Ready