Currently we have complicated model which has objects.
Model:
class Person {
string name{get; set;}
ContactInfo contactInfo{get; set;}
}
class ContactInfo {
string phoneNumber {get; set;}
string address{get; set;}
}
View:
@(Html.Kendo().Grid(Model.Person).Name("testGrid")
.Columns(columns =>
{
columns.Bound(x => x.name);
columns.Bound(x => x.ContactInfo.phoneNumber);
....
in JS Console, with "$("#testGrid").data("kendoGrid").dataSource.data()" I see everything is good at the first load.
However, when I edit "phonenumber", the datasource looks like this:
o
-> Person
->Name:"xxx"
->ContactInfo
->phoneNumber :"xxxx"
->address : "xxxxxx"
->ContactInfo.phoneNumber: ""
we used Jquery.ajax to send the data in js so it has duplicated "ContactInfo.phoneNumber" after stringify, then it never reaches the MVC controller.
Questions:
1. How to solve this issue?
2. How to avoid this additional "ContactInfo.phoneNumber" been created?
Thanks!