This is a migrated thread and some comments may be shown as answers.
Get ParentId in clientside onEdit Event from DetailView
2 Answers 40 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
JULIA
Top achievements
Rank 1
JULIA asked on 15 Sep 2010, 09:01 AM

Hello,

is there a way to get the ParentId in onEdit from DetailView?


function detailEdit(e) {
    if (e.mode == "edit") {
        // ...
    }
    else if (e.mode == "insert") {
        // id of parentRow
    }
}

Regards,
Timo

2 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 15 Sep 2010, 10:04 AM
Hello Timo,

You can achieve your goal with the following code snippet:
function onEdit(e) {
    var masterRow = $(e.form).closest('.t-detail-row').prev();
    var parentDataItem = masterRow.closest('.t-grid').data('tGrid').dataItem(masterRow);
    //TODO: get the required key from the parent DataItem
}

Kind regards,
Georgi Krustev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Derek
Top achievements
Rank 1
answered on 29 Mar 2013, 06:47 PM
This seems to work unless the child grid's editing mode is set to popup.  Is there a way to get the parent object with popup editing?
Tags
Grid
Asked by
JULIA
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Derek
Top achievements
Rank 1
Share this question
or