错误信息:

IE:SCRIPT1009: 缺少 '}'

FF:

SyntaxError: identifier starts immediately after numeric literal

..."id100", "statFlag":"0",stepList:[{"id":100step1,"jobId":100,"stepName":"100step...

出现错误的Ext代码:

                            data:{'total':[
{"id":"100", "jobName":"id100", "statFlag":"0",stepList:[{"id":100step1,"jobId":100,"stepName":"100step1","moniContent":null},{"id":100step2,"jobId":100,"stepName":"100step1","moniContent":null}]},
{"id":"101", "jobName":"id101", "statFlag":"0",stepList:[{"id":101step1,"jobId":101,"stepName":"101step1","moniContent":null},{"id":101step2,"jobId":101,"stepName":"101step1","moniContent":null}]},
{"id":"102", "jobName":"id102", "statFlag":"0",stepList:[{"id":102step1,"jobId":102,"stepName":"102step1","moniContent":null},{"id":102step2,"jobId":102,"stepName":"102step1","moniContent":null}]},
{"id":"103", "jobName":"id103", "statFlag":"0",stepList:[{"id":103step1,"jobId":103,"stepName":"103step1","moniContent":null},{"id":103step2,"jobId":103,"stepName":"103step1","moniContent":null}]}
]}, proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'total'
}
错误原因:
json数据中,字符串数据没有用引号
比较而言,FF的错误提示更准确
 
不知道怎么用Live Writer上传文件,就把完整代码粘上来,相关js,css文件可以去网上下
改正过的代码:
<!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">
<!-- EXT -->
<link rel="stylesheet" type="text/css" href="ext4.0/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="ext4.0/shared/example.css" />
<script type="text/javascript" src="common/js/common.js"></script>
<script type="text/javascript" src="ext4.0/bootstrap.js"></script> <script type="text/javascript" src="common/jquery/jquery-1.3.2.min.js"></script> <title>自动化查看</title>
<style type="text/css">
.icon-grid {
background-image:url(ext4.0/shared/icons/fam/grid.png) !important;
}
.icon-clear-group {
background-image:url(ext4.0/shared/icons/fam/control_rewind.png) !important;
} .progress-out{width:300px;height:20px;background:#EEE;}
.progress-in{width:0px; height:20px;background:#AAA;color:white;text-align:center;}
</style>
<script type="text/javascript">
<!--//
jQuery.noConflict();
Ext.Loader.setConfig({
enabled: true
});
Ext.Loader.setPath('Ext.ux', 'ext4.0/ux');
Ext.onReady(function(){ //JOB 模型
Ext.define('Job', {
extend: 'Ext.data.Model',
fields: ['id', 'jobName','statFlag','stepList']
}); function statFlag(val,meta,model,rowIndex,colIndex) {
if (val == 0) {
return '<span style="color:#gray;">未运行</span>';
} else if (val == 1) {
return '<span style="color:#9AD936;">正在执行</span>';
} else if (val == 2) {
return '<span style="color:red;">运行出错</span>';
} else if (val == 3) {
return '<span style="color:red;">告警一次</span>';
}
return val;
}; function stepFlag(val,meta,model,rowIndex,colIndex) {
if(val == null || val == ''){
val = '<span style="color:#gray;">未运行</span>';
}
return val;
}; Ext.create('Ext.container.Viewport', {
layout: 'border',
padding:2,
items: [{
region: 'center',
layout:'border',
border:false,
flex:2,
items:[
{
region:'center',
title:'总数据',
frame:true,
xtype:'grid',
id:'jobGrid',
columns: [{
text: 'ID',
flex: 1,
dataIndex: 'id'
},{
text: '名称',
flex: 1,
dataIndex: 'jobName'
},{
text: '运行状态',
flex: 1,
renderer:statFlag,
dataIndex: 'statFlag'
}],
store:Ext.create('Ext.data.Store', {
// autoLoad:true,
model: 'Job',
data:{'total':[
{"id":"100", "jobName":"id100", "statFlag":"0",stepList:[{"id":"100step1","jobId":"100","stepName":"100step1","moniContent":null},{"id":"100step2","jobId":"100","stepName":"100step1","moniContent":null}]}, {"id":"101", "jobName":"id101", "statFlag":"0",stepList:[{"id":"101step1","jobId":"101","stepName":"101step1","moniContent":null},{"id":"101step2","jobId":"101","stepName":"101step1","moniContent":null}]}, {"id":"102", "jobName":"id102", "statFlag":"0",stepList:[{"id":"102step1","jobId":"102","stepName":"102step1","moniContent":null},{"id":"102step2","jobId":"102","stepName":"102step1","moniContent":null}]}, {"id":"103", "jobName":"id103", "statFlag":"0",stepList:[{"id":"103step1","jobId":"103","stepName":"103step1","moniContent":null},{"id":"103step2","jobId":"103","stepName":"103step1","moniContent":null}]}
]}, proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'total'
}
}
}),
listeners:{
'selectionchange':function(_this,selected,eOpts){
if(selected.length > 0){
Ext.data.StoreManager.lookup('stepStore').loadData(selected[0].get('stepList'))
}
}
} }
]
}, {
region: 'east',
border:false,
hideCollapseTool:true,
collapsible: true,
split: true,
flex:1,
layout:'border',
items:[
{
region:'center',
flex:1,
title:'步骤列表',
frame:true,
xtype:'grid',
columns: [
{ header: 'ID', dataIndex: 'id',flex:1},
{ header: '步骤', dataIndex: 'stepName', flex: 2 },
{ header: '状态', dataIndex: 'moniContent',flex: 2,renderer:stepFlag}
],
store:Ext.create('Ext.data.Store', {
storeId:'stepStore',
fields:['id', 'stepName', 'moniContent','stepKey'],
data:[],
proxy: {
type: 'memory',
reader: {
type: 'json'
}
}
})
}
]
}]
}); }); //--> </script>
</head>
<body> </body>
</html>

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

 
 
 
 
 
 

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

Extjs报错处理的更多相关文章

  1. Extjs报错:isField为空或不是对象

             在做Extjs开发的时候,有时候会碰到一个奇怪的问题,就是报错说"isField为空或不是对象",经过调试发现是一个数组,显示的长度是21,但是数组里面的个数只有 ...

  2. ExtJs 4.2.1 报错:Uncaught TypeError: Cannot call method 'getItems' of null

    做项目的时候遇到这个问题,搞了一上午终于解决了,让我们看看是什么问题: buttons: [ { text: '保存', icon: '../../../Images/extjs/disk.png', ...

  3. Java Web项目(Extjs)报错五

    1. Java Web项目(Extjs)报错五 具体报错如下: usage: java org.apache.catalina.startup.Catalina [ -config {pathname ...

  4. Java Web项目(Extjs)报错四

    1.Java Web项目(Extjs)报错四 具体报错如下: usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ...

  5. Java Web项目(Extjs)报错三

    1. Java Web项目(Extjs)报错三 具体报错如下: at org.jbpm.pvm.internal.processengine.SpringHelper.createProcessEng ...

  6. Java Web项目(Extjs)报错二

    1.Java Web项目(Extjs)报错二 具体报错如下: usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ...

  7. Java Web项目(Extjs)报错一

    1.Java Web(Extjs)项目报错一 usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -no ...

  8. NetBeans部署项目(Extjs)报错(二)

    NetBeans部署项目(Extjs)报错(二) 1.具体错误如下: Using CATALINA_BASE: "C:\Users\Administrator.FOXB2MKB3RGUNIL ...

  9. NetBeans部署项目(Extjs)报错(一)

    NetBeans部署项目(Extjs)报错(一) 1.用NetBeans将项目部署到Tomcat中,报错. 具体如下: ant -f D:\\NetBeans\\workspace\\Foundati ...

随机推荐

  1. Jersey构建Restful风格的webservices

    最近一直在搞老项目的开发工作,很少写博文了.听了两位阿里巴巴大牛的讨论,决定试试用restful风格的webservices看看. 这里用的是Jersey这个框架,刚开始弄,有点麻烦,只能到处查资料. ...

  2. 曲演杂坛--使用ALTER TABLE修改字段类型的吐血教训

    --===================================================================== 事件起因:开发发现有表插入数据失败,查看后发现INT类型 ...

  3. SQL 取两日期的记录

    SELECT TOP 1000 [ID]      ,[SourcePageID]      ,[PlatformType]      ,[CreateTime]  FROM [home_sendor ...

  4. Asp .Net Core网页数据爬取笔记

    突然要用到地区数据,想到以前用python的Scrapy框架写过一个爬虫,于是打算直接去国家统计局把最新的地区数据抓取回来.本想只需要copy一下以前的代码,就可以得到新鲜出炉的数据,谁知打开以前的项 ...

  5. C++派生类与基类对象赋值情况

    一 .普通赋值 (同名隐藏) 子类对象调用和父类相同的函数名,该父类的函数名会被隐藏,只会调用子类的函数. Class A { public: void show(); void show(int); ...

  6. python 中 使用sys模块 获取运行脚本时在命令行输入的参数

    在python项目的开发的过程中, 经常需要运行各种python脚本, 有时候还需要根据不同的使用情况输入不同的参数, 如果每次都去编辑一下脚本那就太麻烦,太耗费时间了, 这时就可以使用Python自 ...

  7. Mutual Training for Wannafly Union #6 E - Summer Trip(并查集)

    题目链接:http://www.spoj.com/problems/IAPCR2F/en/ 题目大意: 给m个数字代表的大小,之后n组数据,两两关联,关联后的所有数字为一组,从小到大输出组数以及对应的 ...

  8. MySQL DeadLock故障排查过程

    [作者] 刘博:携程技术保障中心数据库高级经理,主要关注Sql server和Mysql的运维和故障处理. [环境] 版本号:5.6.21 隔离级别:REPEATABLE READ [问题描述] 接到 ...

  9. NSTimer、performSelector 函数没有被调用的原因

    performSelector 指定的方法没有被调用 Invokes a method of the receiver on the current thread using the default ...

  10. 了解ORACLE培训OCA-OCP-OCM课程表

    了解ORACLE培训OCA-OCP-OCM课程表考试号: OCA    1Z0-007$125    Oracle Database 10g:SQL Fundamentals 本课程培养学生必要的SQ ...