KLL
2012-08-29 17:17
浏览 264
已采纳

ext4 grid显示问题

<head runat="server">
    <title>Ext-Example</title>
    <link rel="Stylesheet" type="text/css" href="ext-4.0-pr5/resources/css/ext-all.css" />
    <script type="text/javascript" src="ext-4.0-pr5/bootstrap.js"></script>
    
    <script type="text/javascript">   
       
    Ext.onReady(function(){
        Ext.define('MyData',{
            extend:'Ext.data.Model',
            fields:[
                {name:'UserName',mapping:'UserName'},
                'Sex',
                'Age',
                'XueHao',
                'BanJi'
            ]
        });
        
        var store=Ext.create('Ext.data.Store',{
            model:'MyData',
            proxy:{
                type:'ajax',
                url:'Default.aspx',
                reader:{
                    type:'json',
                    root:'items'
                }
            },
            autoLoad:true
        });
        
        var grid=Ext.create('Ext.grid.GridPanel',{
            store:store,
            columns:[
                {text:"姓名",width:120,dataIndex:'UserName',sortable:true},
                {text:"性别",flex:1,dataIndex:'Sex',sortable:false},
                {text:"年龄",width:100,dataIndex:'Age',sortable:true},
                {text:"学号",width:100,dataIndex:'XueHao',sortable:true},
                {text:"班级",width:100,dataIndex:'BanJi',sortable:true}
            ],
            height:400,
            width:480,
            x:20,
            y:40,
            title:'ExtJS4 Grid示例',
            renderTo:'demo',
            viewConfig:{
                stripeRows:true
            }
        });
        
    });

        
    </script>
    
</head>
<body>
    <form id="form1" runat="server">
    <div id="demo">
    
    </div>
    </form>
</body>
</html>

 什么也不显示,var grid=Ext.create('Ext.grid.Panel'改成GridPanel就出现个表一直在呢loading没有数据

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

7条回答 默认 最新

相关推荐 更多相似问题