看看产生此错误的必要条件:
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>竞标管理页面</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" type="text/css" href="js/extjs/resources/css/ext-all.css">
<link rel="stylesheet" type="text/css" href="js/extjs/resources/css/ext-firefox.css">
<script type="text/javascript" src="js/extjs/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="js/extjs/ext-all.js"></script>
<script type="text/javascript" src="js/extjs/build/locale/ext-lang-zh_CN-min.js"></script>
<script type="text/javascript">
Ext.onReady(function(){
//显示列的grid模块
var xg = Ext.grid;
//***********************展示进行中MBCA标单**********************
//数据解析器reader
var oiColumn_reader = new Ext.data.JsonReader({
idProperty:'orderNo',
totalProperty: 'total',
root:'root',
fields: [
{name:'orderNo'},
{name:'creator'},
{name:'tblProductInfo.productName'},
{name:'currency'},
{name:'startDate'},
{name:'endDate'},
{name:'dueDate'},
{name:'enterpriseId'}
]
});
//列结构的数组,改变它就可以实现动态的组装表格.
var oiColumn_columnsArray = [
{header: "标单编号", width: 75, sortable: true, dataIndex: 'orderNo'},
{header: "创建者", width: 50, sortable: true, dataIndex: 'creator'},
{header: "所属产品", width: 75, sortable: true,dataIndex: 'tblProductInfo.productName'},
{header: "货币", width: 40, sortable: true,dataIndex: 'currency'},
{header: "开始时间", width: 75, sortable: true,dataIndex: 'startDate'},
{header: "结束时间", width: 75, sortable: true,dataIndex: 'endDate'},
{header: "决标时间", width: 75, sortable: true,dataIndex: 'dueDate'},
{header: "企业索引码", width: 75, sortable: true,dataIndex: 'enterpriseId'}
];
//列结构的模型model
var oiColumn_columnModel = new xg.ColumnModel({columns:oiColumn_columnsArray});
var oihp = new Ext.data.HttpProxy({url:'oi/orderInfo_findOrderInfoByCreator'});
//数据存储器.
var oiColumn_store = new Ext.data.Store({
reader: oiColumn_reader,
proxy:oihp
});
var cb = new Ext.grid.RowSelectionModel({
singleSelect:true //如果值是false,表明可以选择多行;否则只能选择一行
});
//可编辑表格
var oiColumnGrid = new xg.GridPanel({
store: oiColumn_store,
cm: oiColumn_columnModel,
sm:cb,
bbar:new Ext.PagingToolbar({
pageSize:5,
store:oiColumn_store,
displayInfo:true,
displayMsg:'显示竞标{0}-{1},共有{2}竞标',
emptyMsg:'没有竞标'
}),
viewConfig: {
forceFit:true
},
width: 700,
height: 500,
collapsible: true,
animCollapse: false,
title: '进行中的竞标',
iconCls: 'icon-grid',
renderTo: 'px1Grid',
listeners:{
rowclick:function(grid,row){
}
}
});
oiColumn_store.load({params:{start:0,limit:10}});
//*********************************************************
});
</script>
</head>
<body>sdfff
<div id="center3">
<div id='px1Grid'></div>
</div>
</body>
</html>
这个页面只有一个grid控件,如果在控件的前面有任何除注释以外的字符,如红字所示,包括其他的控件,就会报错误。
解决办法是去掉字符。。
为什么会这样我还不明白。