I have an edit view which has a couple properties, plus an array of child objects. The view uses a tabStrip for those child objects, one tab page per child. Those child objects have a couple properties, and also an array of grandchild objects that are displayed in a grid.
I'm using a partial view to display the child object properties and the grandchildren grid.
The content of the tabStrip pages is defined by:
That provides the automatic prefixing of the child object's controls with "Children[(index)]", such as name="Children[0].SomeChildProperty", which is perfect.
But this causes a problem on the grid for the grandchildren. When I click in a cell to edit it, the input that is created is given name="Children[0].SomeGrandchildProperty". The input textbox is not given the value that was already in the cell, and when I leave the edit cell after changing the value the error is raised "Uncaught TypeError: Cannot read property '0' of undefined" which is shown to be coming from this code (looks like it is in C.extend.set of kendo.all.min.js):
I'm naming the grid on the partial view with .Name("GrandchildrenForChild" + Model.Index), so that eliminates conflicts with the grid itself from having multiple grids on the page. But I don't know how to do deal with the automatic prefix causing problems in the edit cells of the grid. Anyone have ideas how to handle that?
I'm using a partial view to display the child object properties and the grandchildren grid.
The content of the tabStrip pages is defined by:
.Content(Html.PartialFor(model => model.Children[i],
"_TheChildPartialView"
).ToHtmlString());
That provides the automatic prefixing of the child object's controls with "Children[(index)]", such as name="Children[0].SomeChildProperty", which is perfect.
But this causes a problem on the grid for the grandchildren. When I click in a cell to edit it, the input that is created is given name="Children[0].SomeGrandchildProperty". The input textbox is not given the value that was already in the cell, and when I leave the edit cell after changing the value the error is raised "Uncaught TypeError: Cannot read property '0' of undefined" which is shown to be coming from this code (looks like it is in C.extend.set of kendo.all.min.js):
(
function
(d
/**/
) {
return
d.Children[0].SomeGrandchildProperty
})
I'm naming the grid on the partial view with .Name("GrandchildrenForChild" + Model.Index), so that eliminates conflicts with the grid itself from having multiple grids on the page. But I don't know how to do deal with the automatic prefix causing problems in the edit cells of the grid. Anyone have ideas how to handle that?