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

How to find the grid in which the event occured

2 Answers 9 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vijay
Top achievements
Rank 1
Vijay asked on 29 Oct 2013, 02:30 PM
Hi,
    I have multiple grids on a page which share the same change function. Is there a way to find which grid has triggered the event. I need to get the id of that grid and I am using plain HTML and jquery to implement all the grids.
Regards,
Vijay

2 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 29 Oct 2013, 04:33 PM
Hello Vijay,


The context of each event is set to the Grid that triggered it and could be accessed via this.
E.g.
function myEvent(e){
    var grid = this;
    var id = this.wrapper.attr("id");
}

 

Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Ignacio
Top achievements
Rank 1
answered on 29 Oct 2013, 04:33 PM
Hi Vijay,

Here is a small sample that accomplishes this.
http://jsfiddle.net/hLxKV/

Hope it helps.
Tags
Grid
Asked by
Vijay
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Ignacio
Top achievements
Rank 1
Share this question
or