I've got a complex ViewModel:
Ex:
public ExampleViewModel {
public string name {get;set;}
public string description {get;set;}
public List<ExampleViewModelSubItem> Items {get;set;}
// multiple other collections and properties.
}
So I have no problems getting a KendoUI DataSource reading from an MVC route
public JsonObject GetExample() {
return Json(getExample(), AllowJSONGet);
}
What I'm having issues with is how I should go about structuring the data source / pages.
If I had a simple ViewModel it would be easy, load the collection into a grid... Done.
But when I'm faced with a complex ViewModel (Object Graph) it's not quite so simple.
What I had in mind was to create a datasource that queries for the whole object and posts to the whole object.
And then widgets (grids for the lists) bound to each property of the Model.
IE the datasource for a grid might be: model.ObjectList or model.ObjectList.2ndObjectList
In regular MVC.net without the client side components it would be fairly simple.
Using Kendo controls makes it seemingly more complex.
My current plan of attack is to load the entire object graph as JSON into the page, handle client side, and hopefully post it back to the server.
Any suggestions for doing so would be great.
It looks like Kendo really wants to have an write method on the datasource that wants to pump the object back to the server immediatly, which is a problem when it's a grid and we don't want to submit the object until the user is done with their changes.
Thanks much.