日期:2014-05-16 浏览次数:20493 次
public ActionResult ResidentInfo()
{
StringBuilder JsonString = new StringBuilder();
JsonString.Append("{\"total\":10,\"rows\":");
JsonString.Append("[");
//for (int i = 0; i < rTB.Rows.Count; i++)
for (int i = 0; i < 10;i++ )
{
JsonString.Append("{");
JsonString.Append("\"residentID\":\"这是用
户ID\",\"ResidnetName\":\"这是名字\"");
JsonString.Append("}");
if(i<9)
JsonString.Append(",");
}
JsonString.Append("]}");
return Content(JsonString.ToString(),"Application/json");
}
$('#MeteringTable').datagrid({
url: '/Query/ResidentInfo',
columns: [[
{ field: 'productid', title: '用户ID', width: 200 },
{ field: 'productname', title: '用户名', width: 200 }
]]
});