日期:2014-05-17  浏览次数:20678 次

flexgrid的问题
我在用flexgrid动态加载数据的时候,写了一个测试页面test.jsp,数据来源于data.jsp页面。不能正常显示,大家帮忙看看是怎么回事?先谢谢大家了
data.jsp代码<%@ page language="java" contentType="text/html; charset=UTF-8"
  pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%
String strJson = "{\"page\":1,\"total\":2,\"rows\":[{\"cell\":[\"1\",\"宋江\",\"天魁星\",\"黑三郎\"]},{\"cell\":[\"2\",\"吴用\",\"天机星\",\"智多星\"]}]}";

out.println(strJson);

%>


test.jsp的代码
<%@ page language="java" contentType="text/html; charset=UTF-8"
  pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script src="js/flexigrid.js" type="text/javascript"></script>
<script src="js/flexigrid.pack.js" type="text/javascript"></script>
<link rel="stylesheet" href="css/flexigrid.css" type="text/css" >
<link rel="stylesheet" href="css/flexigrid.pack.css" type="text/css" >

</head>
<body>
<table id="flex1" style="display:none"></table>
<script type="text/javascript">
$("#flex1").flexigrid
({

  url: 'data.jsp',
   
  method: 'POST',

  dataType: 'json',

  colModel: [

  { display: '编号', name: 'Unid', width: 40, align: 'center' },

  { display: '姓名', name: 'CustomerName', width: 180, align: 'left' },

  { display: '称号', name: 'Memo', width: 120, align: 'left' },

  { display: '描述', name: 'Other', width: 130, align: 'left' }

  ],

  sortname: "Unid",

  sortorder: "asc",

  usepager: true,

  striped: true,

  title: '简单的应用',

  useRp: false,

  rp: 10,

  width: 'auto',

  height: 255

})
</script>
</body>
</html>

------解决方案--------------------
flex正准备学习,刚毕业,菜鸟一个

mark