Hello All,
I am try to bind kendo grid with json response.
View
Controller
Thanks in an advance.
I am try to bind kendo grid with json response.
View
var dataSource = new kendo.data.DataSource({
transport: {
read: {
url: baseurl + "/Vendor/getData",
type: "POST",
dataType: "json"
}
}
});
$("#mygrid").kendoGrid({
dataSource: dataSource,
height: 280
});
<
div
id
=
"mygrid"
>
</
div
>
Controller
[HttpPost]
public ActionResult getData([DataSourceRequest]DataSourceRequest request)
{
var vendorRegistrationTask = (IVendorRegistrationTask)new VendorTaskFactory<
VendorRegistrationTask
>().CreateObject();
var dataitem = vendorRegistrationTask.getDocument(10);
DataSourceResult result = dataitem.ToDataSourceResult(request);
return Json(result ,JsonRequestBehavior.AllowGet);
}
Thanks in an advance.