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文件,结果只出来表头,没有内容

...全文
313 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
liujianliang 2011-03-25
  • 打赏
  • 举报
回复
本来json里就只包含一行数据,而且在vs里是识别不到js框架的,你说的情况很正常啊
man_zhou_sf 2011-03-24
  • 打赏
  • 举报
回复
qyjEmily 2011-03-23
  • 打赏
  • 举报
回复
你可以去这里查看,很全面的jquery资料:http://jquery-easyui.wikidot.com/document:datagrid

52,797

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ajax
社区管理员
  • Ajax
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧