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

Getting name of sub grid in hierarchy to use in JS

2 Answers 251 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 19 Jan 2016, 03:04 PM

I have implemented a hierarchy grid, and I would like to implement an event to launch a kendowindow on doubleclick of the subgrid.

 

Since the grid is named dynamically "grid_[ID OF ITEM]" I am not sure how to grab the row in script like I would if I knew the grid name.

$('#grid_#=CustomerCode# table tr').live('dblclick', function () {
           // code
  }); 

does not work,and I assume because I cant shove that type of name into JS as it is an asp element. How would I write that query correctly?

2 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay Rusev
Telerik team
answered on 21 Jan 2016, 11:57 AM

Hello Kevin,

 

You can handle detailInit event of the master Grid. And inside that event you can find the detail grid.

 

Example:

 

function detailInit(e) { 

 var detailGridElement = e.detailCell.find("[data-role=grid]");

 var detailGrid = detailGridElement.data("kendoGrid");

}

 

Regards,
Nikolay Rusev
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Kevin
Top achievements
Rank 1
answered on 21 Jan 2016, 04:16 PM

Thanks Nikolay - That worked like a charm.

Tags
Grid
Asked by
Kevin
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Kevin
Top achievements
Rank 1
Share this question
or