Grid(一)

var _grid = new Ext.grid.GridPanel({
     renderTo:Ext.getBody(),
     width:350,
     height:200,
     frame:true,
     enableColumnMove:false, //是否容许列呗拖动
     colModel:new Ext.grid.ColumnModel([{
       header:"姓名",
       dataIndex:"name",
       menuDisabled:true, //去除selectMenu
       align:"center"
      },{
       header:"年龄",
       sortable:true,
       dataIndex:"age"
      },{
       header:"性别" ,
       dataIndex:"sex"
      }]),
      store:new Ext.data.JsonStore({
       //data:[{name:"你好", age:"20", sex:"女"},{name:"谁呀", age:"22", sex:"男"}],
       //fields:["name", "sex", "age"]
       autoLoad:true,
       proxy: new Ext.data.HttpProxy({url:"test.jsp"}),
       fields:["name", "sex", "age"]
      }),
      selModel:new Ext.grid.RowSelectionModel({singleSelect:true}) 
   });

可以使用data, Json, Xml

你可能感兴趣的:(json,xml,header,url,autoload)