easyui datagrid不能绑定数据
_生活 2011-03-22 06:00:42 一个html文件,内容如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="zh-CN" />
<title>jQuery EasyUI</title>
<link rel="stylesheet" type="text/css" href="themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="themes/icon.css">
<script type="text/javascript" src="jquery-1.4.1-vsdoc.js"></script>
<script type="text/javascript" src="easyui.min.js"></script>
<script>
$(function(){
$("#tt").datagrid({
title: '潜在客户列表',
rownumbers: true,
url: 'test.json',
border: true,
loadMsg: '正在装载数据,请稍等......',
columns: [[
{ field: 'cCustomNo', title: '客户编号', width: 80, align: 'center' },
{ field: 'cCustomName', title: '客户名称' },
{ field: 'cCustomStyle', title: '客户类别', align: 'center' },
{ field: 'cTrade', title: '行业', align: 'center' },
{ field: 'cEstablishDate', title: '成立日期' },
{ field: 'iRegCapital', title: '注册资金(万元)', align: 'right' },
{ field: 'iTaking', title: '营业收入', align: 'right' },
{ field: 'iEmployeeNum', title: '员工人数', align: 'right' },
{ field: 'cRequirement', title: '需求意向', align: 'center' },
{ field: 'cReqRemark', title: '需求备注' },
{ field: 'cRemark', title: '备注' }
]],
pagination: true,
pageSize: 3, //每页记录数
pageList: [3, 50] //分页记录数数组
});
});
</script>
</head>
<body>
<h1>测试Convert a HTML table to DataGrid</h1>
<table id="tt">
</table>
</body>
</html>
一个test.json文件,内容如下:
{"total":8,"rows":[{"cCustomNo":"000001","cCustomName":"customname","cCustomKey":"cuskey","cRemark":"remark","cCustomStyle":"style","cTrade":"trade","cEstablishDate":"estdate","iRegCapital":"0","iTaking":"0","iEmployeeNum":"0","cCompanyURL":"url","bHaveLawyer":"ab","bHaveLegalMan":"ab","cRequirement":"requirement","cReqRemark":"reqremark","cDevelopID":"devid","cDevelopName":"devname","cRecordID":"recid","cRecordName":"recname","cPopedom":"gk"}]}
我直接双击html文件,在datagrid可以显示一行数据,如果我通过asp.net工程访问这个html文件,结果只出来表头,没有内容