I am changing the url of a grid and then sending an object as a parameter. The grid is calling the new controller I want, but the view model is empty. What am I missing?
New grid datasource:
Replacing grid datasource:
Controller:
ViewModel:
1.return mvvm.toJSON(self, function (data) {2. data.Criteria = self._grid.dataSource.data();3. });New grid datasource:
01.var dataSource = new kendo.data.DataSource({02. page: ds.page(),03. pageSize: ds.pageSize(),04. sort: ds.sort(),05. type: "aspnetmvc-ajax",06. transport: {07. prefix:"",08. read: {09. url: "/AdvancedSearch/GetResults",10. dataType: "json",11. data: { criteria: data },12. type: "POST",13. traditional: true,14. contentType: "application/json",15. }16. }17.});Replacing grid datasource:
1.self.bindings.controls.EquipmentListGrid.setDataSource(dataSource);2.self.bindings.controls.EquipmentListGrid.rebind();Controller:
1.[HttpPost]2.public ActionResult GetResults([DataSourceRequest] DataSourceRequest request, AdvancedSearchViewModel criteria)3.{4.}ViewModel:
01.[Serializable]02.public class AdvancedSearchViewModel03. {04. [DisplayName("Include Junk Pool")]05. public bool IncludeJunkPool { get; set; }06. public List<string> Areas { get; set; }07. public List<string> GeoMarkets { get; set; }08. public bool ApplyBasket { get; set; }09. public IList<int> Basket { get; set; }10. public bool Export { get { return true; } }11. 12. public string Page { get; set; }13. public string Column { get; set; }14. public string DisplayName { get; set; }15. public string Operator { get; set; }16. public string Value { get; set; }17. public string DataType { get; set; }18. public string Table { get; set; }19. 20. public IList<AdvancedSearchListItem> Criteria { get; set; }21. 22. public CurrentPage CurrentPage { get; set; }23. public Sort Sort { get; set; }24.}