Ext.onReady(function()
{
       var data=[[1,'a','a','a.com'],[2,'b','b','b.com'],[3,'c','c','c.com'],[4,'d','d','asdfd.com']];
           var store=new Ext.data.ArrayStore({data:data,fields:["id","name","organization","homepage"]});
           var help1=new Ext.grid.GridPanel({
            title:"中国java开发团队1",
                   height:150,
                   autoExpandColumn:1,
                   width:800,
                   columns:[{header:"项目名称",dataIndex:"name"},{header:"开发团队",dataIndex:"organization"},{header:"网址",dataIndex:"homepage"}],
                   store:store}
                    );
            var help2=new Ext.grid.GridPanel({
         title:"中国java开发团队2",
               height:150,
               width:800,
               columns:[{header:"项目名称",dataIndex:"name"},{header:"开发团队",dataIndex:"organization"},{header:"网址",dataIndex:"homepage"}],
               store:store,
               autoExpandColumn:1}
                );
            var help3=new Ext.grid.GridPanel({
         title:"中国java开发团队3",
                height:150,
                autoExpandColumn:1,
                width:800,
                columns:[{header:"项目名称",dataIndex:"name"},{header:"开发团队",dataIndex:"organization"},{header:"网址",dataIndex:"homepage"}],
                store:store}
                 );
            var obj={
                      width:800,
                      heght:1000,
                      activeTab:0,
                      frame:true,
               
                      tabPosition: 'bottom',
                      items:[help1,
                          help2,help3]
                     };
           var panel=new Ext.TabPanel(obj);
           panel.render("hello");
    });
<div id="hello" height=1000></div>这是我做的一个实验,三个gridpanel的数据源都是一个,但是第一个help1在IE就是不能正常显示,后面两个可以正常加载数据,在firfox可以三个都可以看到,不知道是为什么,请高手指教

解决方案 »

  1.   

    第一个help1在IE就是不能正常显示
    是不是IE6?
      

  2.   

    我刚测试了一下,的确如楼主一样,在 IE6, IE7下面第一页不能正常显示,但在 IE8 和 firefox 下是可以正常显示的
      

  3.   

    原因不太清清楚,可能浏览器的 dom 原因吧, 解决方法可以这样, 加上 autoHeight: truevar help1=new Ext.grid.GridPanel({
                   id: 'aa1',
                       title:"中国java开发团队1",
                      autoHeight: true, // 加上这个
                       height:150,
                       autoExpandColumn:1,
                       width:800,
                       columns:[{header:"项目名称",dataIndex:"name"},{header:"开发团队",dataIndex:"organization"},{header:"网址",dataIndex:"homepage"}],
                       store:store}
                        );
      

  4.   

    删除掉这行autoExpandColumn: 1,Ext.onReady(function() {
        var data = [[1, 'a', 'a', 'a.com'], [2, 'b', 'b', 'b.com'], [3, 'c', 'c', 'c.com'], [4, 'd', 'd', 'asdfd.com']];
        var store = new Ext.data.ArrayStore({ data: data, fields: ["id", "name", "organization", "homepage"] });
        var help1 = new Ext.grid.GridPanel({
            title: "中国java开发团队1",
            height: 150,
            width: 800,
            columns: [{ header: "项目名称", dataIndex: "name" }, { header: "开发团队", dataIndex: "organization" }, { header: "网址", dataIndex: "homepage"}],
            store: store
        }
                        );
        var help2 = new Ext.grid.GridPanel({
            title: "中国java开发团队2",
            height: 150,
            width: 800,
            columns: [{ header: "项目名称", dataIndex: "name" }, { header: "开发团队", dataIndex: "organization" }, { header: "网址", dataIndex: "homepage"}],
            store: store
        }
                    );
        var help3 = new Ext.grid.GridPanel({
            title: "中国java开发团队3",
            height: 150,
            width: 800,
            columns: [{ header: "项目名称", dataIndex: "name" }, { header: "开发团队", dataIndex: "organization" }, { header: "网址", dataIndex: "homepage"}],
            store: store
        }
                     );
        var obj = {
            width: 800,
            heght: 1000,
            activeTab: 0,
            frame: true,        tabPosition: 'bottom',
            items: [help1,
                              help2, help3]
        };
        var panel = new Ext.TabPanel(obj);
        panel.render("hello");
    });
      

  5.   

    问题我现在已经解决了,那个tabpanel里面的height拼写错误,改了以后就好了