In javascript, based on user selection, I want to dynamically change grid datasource, reading data from controller. sample codes below
var data = $('#MarketDrivers').data('kendoTreeView').dataItem(e.node);
//chart2.setDataSource(ds2);
var gd = $("#grid").data("kendoGrid");
var ds3 = new kendo.data.DataSource({
transport: {
read: {
type: "POST",
url: "/Blotter/getIDView",
data: { factorID_: data.id },
dataType: "jsonp"
}
}
});
gd.setDataSource(ds3);
This controller action will be triggered, but the grid will show "No items to display". My controller action is like below...
public ActionResult getIDView([DataSourceRequest] DataSourceRequest request, int? factorID_)
{
List<PersonView> li = new List<PersonView>();
//some code here...
return Json(li.ToDataSourceResult(request));
}
Anyone knows what's wrong here? Thanks