最近在接触EXTJS....网上找了个简明实用教程,照着写代码练习,遇上了让我头爆的郁闷问题:
以下这两段代码有哪里不一样?我自己照着写的,运行就报错:
错误信息:
消息: 'undefined' 为空或不是对象 行: 10113 字符: 9 代码: 0 URI: http://localhost:8888/learnEXTJS/js/extjs/ext-all.js
我照着例子敲的代码:
Ext.onReady(function(){ alert("sss"); var data = [[1,'EasyJWeb','EasyJF','www.easyjf.com'],[2,'jfox','huihoo','www.huihoo.org'],[3,'jdon','jdon','www.jdon.com'],[4,'springside','springside','www.springside.org.cn'],]; var store = new Ext.data.SimpleStore({data:data,fields:["id","name","organization","homepage"]}); var grid = new Ext.grid.GridPanel({ renderTo:"divId", title:"中国Java开源产品及团队", height:150, width:600, columns:[{header:"项目名称",dataIndex:"name"}, {header:"开发团队",dataIndex:"organization"}, {header:"网址",dataIndex:"homepage"}], store:store, autoExpandColumn:2 }); });
复制的代码:
Ext.onReady( function() { var data = [ [ 1, 'EasyJWeb', 'EasyJF', 'www.easyjf.com' ], [ 2, 'jfox', 'huihoo', 'www.huihoo.org' ], [ 3, 'jdon', 'jdon', 'www.jdon.com' ], [ 4, 'springside', 'springside', 'www.springside.org.cn' ] ]; var store = new Ext.data.SimpleStore( { data : data, fields : [ "id", "name", "organization", "homepage" ] }); var grid = new Ext.grid.GridPanel( { renderTo : "divId", title : "中国Java开源产品及团队", height : 150, width : 600, columns : [ { header : "项目名称", dataIndex : "name" }, { header : "开发团队", dataIndex : "organization" }, { header : "网址", dataIndex : "homepage" } ], store : store, autoExpandColumn : 2 }); });
复制的代码正常运行..................................
敲的代码是小妈生的么。。。就这么不待见。。。。。
。