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

[Solved] Master Detail Grids

2 Answers 82 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jeff
Top achievements
Rank 1
Jeff asked on 12 Aug 2011, 03:42 PM
Just a quick question but is it possible to have a clientTemplate on my child grid in a master detail setup render a partial view?

Thanks

Jeff.........

2 Answers, 1 is accepted

Sort by
0
Jeff
Top achievements
Rank 1
answered on 15 Aug 2011, 11:14 AM
Having looked at the documents I can see that this possible on a client template by using the

OnDetailViewExpand event which I have done with the follwing code

.DetailView(detailview => detailview.ClientTemplate("<div id='section_<#=SectionID #>'>Section details partial veiw <#=SectionID #></div>"))
.ClientEvents(events => events.OnDetailViewExpand("displaySectionDataByType"))
.ToHtmlString()

However I am not sure how to get to the ID of the div i.e. "section_4" once I hit the event triggered code. I can access the event.detailRow but how do I get the Div's ID??

function displaySectionDataByType(event) {
    alert(event.detailRow);
    $("#section_4").html("Blah updated by the function from here");
}

Is it possible to pass any other arguments into the function, once more any help would really get me moving again.

Thanks

Jeff...........


0
Jeff
Top achievements
Rank 1
answered on 15 Aug 2011, 11:49 AM
Managed to get the id I wanted witht the following code

function displaySectionDataByType(event) {
    var cell = event.detailRow.cells[1];
    var section = $('div', cell).attr("id");
    $('#' + section).html("Blah updated by the fucntion from here");
}
 But this seems a little clunky,, can anyone recommend a better way???

Thanks Jeff...................
Tags
Grid
Asked by
Jeff
Top achievements
Rank 1
Answers by
Jeff
Top achievements
Rank 1
Share this question
or