简单的GridPanel

Ext.onReady(function (){
    var _grid=new Ext.grid.GridPanel({
    renderTo:Ext.getBody(),
height:200,
width:350,
    //colModel等同于columns
    colModel:new Ext.grid.ColumnModel([
                        {header: "姓名", width: 100, sortable: true, dataIndex: 'change'},
                        {header: "年龄", width: 100, sortable: true, dataIndex: 'pctChange'},
                        {header: "性别", width: 100, sortable: true, dataIndex: 'lastChange'}
]);
     store:new Ext.data.JsonStore({
     data:[{name:"sss",age:28,sex:"男"},{name:"sss",age:28,sex:"女"}],//存放到数组里
fields:["name","sex","age"]
    })
});
  
})

你可能感兴趣的:(ext)