为什么在页面上不显示grid表格

<!DOCTYPE html>


test_1.html
<link rel="stylesheet" type="text/css" href="./extjs4/resources/css/ext-all.css">
<script type="text/javascript" src="./extjs4/bootstrap.js"></script>
<script type="text/javascript" src="./extjs4/ext-all.js"></script>

<script>

  Ext.onReady(function(){

// alert("hello world");
// Ext.MessageBox.alert("hello","hello world");
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:"hello",
       title:"中国Java开源产品及团队",
       height:150,
       width:600, 
       columns:[{header:"项目名称",dataIndex:"name"},
                {header:"开发团队",dataIndex:"organization"},
                {header:"网址",dataIndex:"homepage"}],
       store:store,
       autoExpandColumn:2
 }); 

});

</script>


This is my HTML page.


首先你用的是4版本 而你的写法确是2,3版本的写法
最关键的是 renderTo:"hello", 但是没有


还是先看看4版本的官方grid例子吧

[code="java"] <br> Ext.onReady(function(){<br> //创建表格数据<br> var datas = [<br> [100,&#39;张三&#39;,24],<br> [200,&#39;李四&#39;,30],<br> [300,&#39;王五&#39;,29]<br> ];<br> //创建Grid表格组件<br> Ext.create(&#39;Ext.grid.Panel&#39;,{<br> title : &#39;简单Grid表格示例&#39;,<br> renderTo: Ext.getBody(),<br> width:200,<br> height:130,<br> frame:true,<br> viewConfig: {<br> forceFit : true,<br> stripeRows: true//在表格中显示斑马线<br> },<br> store: {//配置数据源<br> fields: [&#39;id&#39;,&#39;name&#39;,&#39;age&#39;],//定义字段<br> proxy: {<br> type: &#39;memory&#39;,//Ext.data.proxy.Memory内存代理<br> data : datas,//读取内嵌数据<br> reader : &#39;array&#39;//Ext.data.reader.Array解析器<br> },<br> autoLoad: true//自动加载<br> },<br> columns: [//配置表格列<br> {header: &quot;id&quot;, width: 30, dataIndex: &#39;id&#39;, sortable: true},<br> {header: &quot;姓名&quot;, width: 80, dataIndex: &#39;name&#39;, sortable: true},<br> {header: &quot;年龄&quot;, width: 80, dataIndex: &#39;age&#39;, sortable: true}<br> ]<br> });<br> });<br>

没有发现id为hello的div

请检查代码

[code="java"]
renderTo:"hello"
[/code]

把你的ext代码放在body里边试试!