
Ext表格无法读取sql2000数据
Ext表格读取sql2000里northwind表数据,无法显示,无错误提示表格页面代码如下:<%@pagelanguage="java"contentType="tex...
Ext表格读取sql2000里northwind表数据,无法显示,无错误提示
表格页面代码如下:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>产品信息</title>
<link rel="stylesheet" type="text/css" href="ext2.2/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="ext2.2/style.css" />
<script type="text/javascript" src="ext2.2/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="ext2.2/ext-all.js"></script>
<script type="text/javascript">
Ext.onReady(function(){
var store = new Ext.data.Store({
autoLoad :{params:{start : 0,limit : 100}},
reader: new Ext.data.JsonReader(),
proxy : new Ext.data.HttpProxy({
url : 'productinfo.jsp'
})
}); //从数据库读取数据
var colM=new Ext.grid.ColumnModel([
{header: "productid",sortable: true, width: 200,dataIndex:"productid"},
{header:"productname",sortable: true,width: 200, dataIndex:"productname"},
{header:"supplierid", sortable: true,width: 200,dataIndex:"supplierid"},
{header:"categoryid", sortable: true,width: 200,dataIndex:"categoryid"}
]);
var grid1 = new Ext.grid.GridPanel({
renderTo:"grid1",
title:"产品信息",
height:200,
width:800,
tbar : new Ext.PagingToolbar({//分页工具栏
store : store,
pageSize : 15,
displayInfo : true,
displayMsg : '第 {0} 条到 {1} 条,总共 {2} 条',
emptyMsg : "没有记录"
}),
cm:colM,
store:store,
autoExpandColumn:2
});
});
</script>
</head>
<body>
<div id="grid1"></div>
</body>
</html>
数据读取部分
http://zhidao.baidu.com/question/150287611.html?fr=middle_ask 展开
表格页面代码如下:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>产品信息</title>
<link rel="stylesheet" type="text/css" href="ext2.2/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="ext2.2/style.css" />
<script type="text/javascript" src="ext2.2/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="ext2.2/ext-all.js"></script>
<script type="text/javascript">
Ext.onReady(function(){
var store = new Ext.data.Store({
autoLoad :{params:{start : 0,limit : 100}},
reader: new Ext.data.JsonReader(),
proxy : new Ext.data.HttpProxy({
url : 'productinfo.jsp'
})
}); //从数据库读取数据
var colM=new Ext.grid.ColumnModel([
{header: "productid",sortable: true, width: 200,dataIndex:"productid"},
{header:"productname",sortable: true,width: 200, dataIndex:"productname"},
{header:"supplierid", sortable: true,width: 200,dataIndex:"supplierid"},
{header:"categoryid", sortable: true,width: 200,dataIndex:"categoryid"}
]);
var grid1 = new Ext.grid.GridPanel({
renderTo:"grid1",
title:"产品信息",
height:200,
width:800,
tbar : new Ext.PagingToolbar({//分页工具栏
store : store,
pageSize : 15,
displayInfo : true,
displayMsg : '第 {0} 条到 {1} 条,总共 {2} 条',
emptyMsg : "没有记录"
}),
cm:colM,
store:store,
autoExpandColumn:2
});
});
</script>
</head>
<body>
<div id="grid1"></div>
</body>
</html>
数据读取部分
http://zhidao.baidu.com/question/150287611.html?fr=middle_ask 展开
1个回答
展开全部
extjs只是调用productinfo.jsp页面执行完毕后产生的数据而已,它并不对数据库进行读取,因此数据库的类型与调用是否成功没有任何关系。因此,
1.要确保productinfo.jsp可以产生数据;
2.productinfo.jsp页面产生的数据符合Json数据格式。
你的程序中productinfo.jsp页面产生的数据应该为:
[
{"productid":123,"productname":"对应名称","supplierid":1600,"categoryid":12313},
...
{"productid":125,"productname":"对应名称","supplierid":1606,"categoryid":12318}
]
3.两个页面的编码需统一,如统一使用utf-8或gb2312等。
可先单独测试下productinfo.jsp,如无问题再确认是否是Extjs程序代码的问题。
1.要确保productinfo.jsp可以产生数据;
2.productinfo.jsp页面产生的数据符合Json数据格式。
你的程序中productinfo.jsp页面产生的数据应该为:
[
{"productid":123,"productname":"对应名称","supplierid":1600,"categoryid":12313},
...
{"productid":125,"productname":"对应名称","supplierid":1606,"categoryid":12318}
]
3.两个页面的编码需统一,如统一使用utf-8或gb2312等。
可先单独测试下productinfo.jsp,如无问题再确认是否是Extjs程序代码的问题。

2022-08-05 广告
苏州蓝晓生物科技有限公司。标准化核心产品:公司拥有完整的琼脂糖介质、葡聚糖介质、聚甲基丙烯酸酯介质生产线,年产分离介质50000L,产品质量稳定并达到国际领先水平。核心优势:公司核心技术人员拥有近二十年不同基质的基球开发和官能化的丰富技术经...
点击进入详情页
本回答由苏州蓝晓生物科技有限公司_提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询