日期:2014-05-17 浏览次数:20336 次
public JsonResult GetData() { var hh = new[] { new {id= "1", Name= "XXX", successCount= "2", totalCount= "3", ttl= "20", dataSize= "1"}, new {id= "1", Name= "XXX", successCount= "2", totalCount= "3", ttl= "20", dataSize= "1"}, new {id= "1", Name= "XXX", successCount= "2", totalCount= "3", ttl= "20", dataSize= "1"}, new {id= "1", Name= "XXX", successCount= "2", totalCount= "3", ttl= "20", dataSize= "1"} }; return Json(hh, JsonRequestBehavior.AllowGet); }
<script type="text/javascript"> jQuery(document).ready(function () { jQuery("#jqList").jqGrid({ url: '/Home/GetData', datatype: "json", colNames: ['id', 'File Name', 'Successfully published', 'File-sets dropped', 'TTL(Min)', 'Data Size(MB)'], colModel: [ { name: 'id', index: 'id', width: 100 }, { name: 'Name', index: 'Name', width: 200}, { name: 'successCount', index: 'successCount', width: 160}, { name: 'totalCount', index: 'totalCount', width: 120 }, { name: 'ttl', index: 'ttl', width: 120}, { name: 'dataSize', index: 'dataSize', width: 120} ], pager: '#jqList', sortname: 'id', viewrecords: true, sortorder: "desc", }).navGrid("#jqList",{ edit: true, add: true, del: true }); }) </script>