<div id="grid"></div>
(document).ready(function() {
var dataSourceA = new kendo.data.DataSource({
transport: {
read: "../Test/CourseRead",
dataType: "json"
}
});
$("#grid").kendoGrid({
dataSource: dataSourceA,
height: 550,
groupable: true,
sortable: true,
pageable: {
refresh: true,
pageSizes: true,
buttonCount: 5
},
columns: [{
field: "CourseName",
title: "Course Name",
width: 240
}]
});
});
public ActionResult CourseRead([DataSourceRequest]DataSourceRequest request)
{
IQueryable<CourseInformationMasterViewModel> course = (from m in db.CourseInformationMasters
select new CourseInformationMasterViewModel{
CourseName=m.CourseName,
CourseCode=m.CourseCode,
CourseCredit=m.CourseCredit,
MasterCourseId=m.MasterCourseId
});
DataSourceResult result = course.ToDataSourceResult(request);
return Json(result);
}
我的行動methos的名字是CourseRead和控制器的名字是Test.action方法燒製,但顯示空grid.json結果返回值我chechk this.but網格是空的。劍道電網閱讀的操作方法不火