kongrui123as 2012-06-27 10:50
浏览 498
已采纳

为什么在页面上不显示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条回答

  • works001 2012-06-27 10:54
    关注

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


    还是先看看4版本的官方grid例子吧
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误