Find grid row from embedded chart click

3 posts, 1 answers
  1. Eugenio
    Eugenio avatar
    3 posts
    Member since:
    Sep 2020

    Posted 06 Oct 2020 Link to this post

    Hi,

    I have a grid with an embedded bar chart. The bar chart is firing a seriesClick() event.
    How can I find the grid row containing the chart that fired the event?

    Prototype is in this snippet copied from the embedded chart demo. Just click in any bar of a chart.
    https://dojo.telerik.com/@eyep/exIVAraw

    Thanks in advance,

    Eugenio Yep

     

  2. Answer
    Alex Hajigeorgieva
    Admin
    Alex Hajigeorgieva avatar
    1082 posts

    Posted 08 Oct 2020 Link to this post

    Hello, Eugenio,

    The seriesClick event emits the chart instance(e.sender or this) which triggered it. You can use it to navigate to the current row:

    https://dojo.telerik.com/@bubblemaster/axoHolap

    seriesClick: function(e){           
          // this is the row of the grid on which the chart is rendered       	
         var row = this.element.closest("tr");
          // this is the dataItem to which the row is bound
         var dataItem = grid.dataItem(row);
         kendo.alert(dataItem.FirstName);
    }

    Kind Regards,
    Alex Hajigeorgieva
    Progress Telerik

    Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

  3. Eugenio
    Eugenio avatar
    3 posts
    Member since:
    Sep 2020

    Posted 08 Oct 2020 in reply to Alex Hajigeorgieva Link to this post

    Thanks Alex!
    I was missing the ".element" part
Back to Top