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

Radgrid parentID javascript

1 Answer 53 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 06 Oct 2018, 02:55 PM
The radgrid has 3 parent tiers before getting to the details. Using a command template I like to create a new detail record by passing parentID. When clicking on add new record, I bring up a radwindow for the user to enter the data in the new record form. The radwind is shown using javascript. 


I would like to pass the parent ID from the third tier to the new record form. Unfortunately I can not find the parent id using javascript.


function openConfirmationWindowNEW(sender, args) {


// ... not working getting parentID "progranID"
var myprogramID = $find(Telerik.Web.UI.Grid.GetFirstParentByTagName(sender.get_element().parentNode, "ProgramID").id);

radopen("newrecord.aspx?carID= " + programID , "RadWindow2");
}




1 Answer, 1 is accepted

Sort by
0
Attila Antal
Telerik team
answered on 10 Oct 2018, 05:51 PM
Hi John,

It happened that I have a sample project with a 2 level hierarchical RadGrid, which has buttons in the DetailTable and if they are getting clicked, they get a reference to the parent item as dataItem, and/or TableView. The same approach can be used to achieve a scenario for a 3 or more level Hierarchical grid.

Please check out the attached webforms page. All you need is to import it into a Website and run it. Since it has dummy data bound to it, there is no need to setup SQL connection. I've tried to descriptive in the code as much as possible.

Please let us know if you have questions.

Kind regards,
Attila Antal
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
John
Top achievements
Rank 1
Answers by
Attila Antal
Telerik team
Share this question
or