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

Find grid row from embedded chart click

2 Answers 75 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Eugenio
Top achievements
Rank 1
Eugenio asked on 06 Oct 2020, 07:47 PM

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 Answers, 1 is accepted

Sort by
0
Accepted
Alex Hajigeorgieva
Telerik team
answered on 08 Oct 2020, 03:35 PM

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/.

0
Eugenio
Top achievements
Rank 1
answered on 08 Oct 2020, 04:10 PM
Thanks Alex!
I was missing the ".element" part
Tags
Grid
Asked by
Eugenio
Top achievements
Rank 1
Answers by
Alex Hajigeorgieva
Telerik team
Eugenio
Top achievements
Rank 1
Share this question
or