在jsp页面中使用Extjs,在浏览器中访问状态栏中会有脚本错误提示ext-all.js中“meta”为空或不是对象
除了“meta”为空或不是对象,点击查询的时候会提示“缺少函数”以下是我的jsp页面代码<%@pagelanguage="java"import="java.util.*...
除了“meta”为空或不是对象,点击查询的时候会提示“缺少函数”
以下是我的jsp页面代码
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
<base href="<%=basePath%>">
<title></title>
<meta http-equiv="pragma" content="no-cache">
<link rel="stylesheet" type="text/css" href="<%=path %>/extjs/ext-all.css">
<link rel="stylesheet" type="text/css" href="<%=path %>/extjs/ht.css">
<script type="text/javascript" src="<%=path %>/extjs/ext-base.js"></script>
<script type="text/javascript" src="<%=path %>/extjs/ext-all.js"></script>
<script type="text/javascript" src="<%=path %>/extjs/ext-lang-zh_CN.js"></script>
<script type="text/javascript">
var startDate = new Ext.form.DateField({
format : "Y-m-d"
});
var endDate = new Ext.form.DateField({
format : "Y-m-d"
});
var store = new Ext.data.Store({
url:"/excelout_tc/showpage",
reader:Ext.data.JsonReader({
root:'rows'
},[
{name:'uSERNAME',mapping:'uSERNAME'},
{name:'jGDM'} ]
),
autoLoad:true
});
store.on('beforeload', function() {
Ext.apply(this.baseParams, {
startdate : startDate.getValue() ? startDate
.getValue().format("Ymd") : "",
enddate : endDate.getValue() ? endDate.getValue().format("Ymd") : ""
});
});
var grid = new Ext.grid.GridPanel({
region : "center",
border : false,
store : store,
columns : [
{
dataIndex:'uSERNAME',
header:'医疗机构',
width:90
},{
dataIndex:'jGDM',
header:'组织机构代码',
width:110
} ],
sm : new Ext.grid.RowSelectionModel({
singleSelect : true
}),
tbar : [
"开始时间:", startDate, "-",
"截止时间:", endDate, "-",
{
text : "查询",
iconCls : "ht-icon-view",
handler : function() {
searchFun();
}
},{
text : "导出Excel",
iconCls : "ht-icon-view",
handler : function() {
exportExcel();
}
}
]
});
function searchFun(){
var sdate = startDate.getValue()?endDate.format("Ymd"):"";
var edate = endDate.getValue()?endDate.format("Ymd"):"";
if(sdate.length <= 0 || edate.length<=0){
alert("请选择开始时间和截止时间");
return;
}
alert(sdate);
store.load({
params :{
startdate:startDate.getValue()?endDate.format("Ymd"):"",
enddate:endDate.getValue()?endDate.format("Ymd"):""
}
});
}
function exportExcel(){
document.location.href="/excelout_tc/outexcel";
}
Ext.onReady(function() {
new Ext.Viewport({
layout : "border",
items : [grid]
});
});
</script>
</head>
<body></body>
</html> 展开
以下是我的jsp页面代码
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
<base href="<%=basePath%>">
<title></title>
<meta http-equiv="pragma" content="no-cache">
<link rel="stylesheet" type="text/css" href="<%=path %>/extjs/ext-all.css">
<link rel="stylesheet" type="text/css" href="<%=path %>/extjs/ht.css">
<script type="text/javascript" src="<%=path %>/extjs/ext-base.js"></script>
<script type="text/javascript" src="<%=path %>/extjs/ext-all.js"></script>
<script type="text/javascript" src="<%=path %>/extjs/ext-lang-zh_CN.js"></script>
<script type="text/javascript">
var startDate = new Ext.form.DateField({
format : "Y-m-d"
});
var endDate = new Ext.form.DateField({
format : "Y-m-d"
});
var store = new Ext.data.Store({
url:"/excelout_tc/showpage",
reader:Ext.data.JsonReader({
root:'rows'
},[
{name:'uSERNAME',mapping:'uSERNAME'},
{name:'jGDM'} ]
),
autoLoad:true
});
store.on('beforeload', function() {
Ext.apply(this.baseParams, {
startdate : startDate.getValue() ? startDate
.getValue().format("Ymd") : "",
enddate : endDate.getValue() ? endDate.getValue().format("Ymd") : ""
});
});
var grid = new Ext.grid.GridPanel({
region : "center",
border : false,
store : store,
columns : [
{
dataIndex:'uSERNAME',
header:'医疗机构',
width:90
},{
dataIndex:'jGDM',
header:'组织机构代码',
width:110
} ],
sm : new Ext.grid.RowSelectionModel({
singleSelect : true
}),
tbar : [
"开始时间:", startDate, "-",
"截止时间:", endDate, "-",
{
text : "查询",
iconCls : "ht-icon-view",
handler : function() {
searchFun();
}
},{
text : "导出Excel",
iconCls : "ht-icon-view",
handler : function() {
exportExcel();
}
}
]
});
function searchFun(){
var sdate = startDate.getValue()?endDate.format("Ymd"):"";
var edate = endDate.getValue()?endDate.format("Ymd"):"";
if(sdate.length <= 0 || edate.length<=0){
alert("请选择开始时间和截止时间");
return;
}
alert(sdate);
store.load({
params :{
startdate:startDate.getValue()?endDate.format("Ymd"):"",
enddate:endDate.getValue()?endDate.format("Ymd"):""
}
});
}
function exportExcel(){
document.location.href="/excelout_tc/outexcel";
}
Ext.onReady(function() {
new Ext.Viewport({
layout : "border",
items : [grid]
});
});
</script>
</head>
<body></body>
</html> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询