用ajax如何绑定KendoUI Grid 传送数据
这是我前台代码
$(function () {
$("#grid").kendoGrid({
dataSource: {
transport: {
dataType: "json",
read: "/KendoUI/Index"
},
pageSize: 5,
},
pageable: {
refresh: true,
pageSizes: true,
buttonCount: 5
},
columns: [{
field: "Stu_Id",
title: "学生编号",
width: 200
}, {
field: "Stu_Name",
title: "学生姓名"
}, {
field: "Stu_Age",
title: "学生年龄"
}, {
field: "Stu_Class",
title: "所属班级"
}]
});
});
后台动作方法就这样
public ActionResult Index([DataSourceRequest]DataSourceRequest request)
{
return Json(manager.getAll(),JsonRequestBehavior.AllowGet); //manager.getall()是调用的业务层的方法
}