Ext.onReady(function() { var proxy = new Ext.data.HttpProxy({ url: 're.aspx'});//获取json数据 var reader = new Ext.data.JsonReader( { totalProperty: "results", root: "datastr", id: 'productID' }, [ { name: 'productID' }, { name: 'productName' }, { name: 'productCode'} ] ); var store = new Ext.data.Store( { proxy: proxy, reader: reader }); store.load(); //加载数据 //创建grid var grid = new Ext.grid.GridPanel({ renderTo: 'grid', 650, store: store, loadMask: true, viewConfig: { forceFit: true }, autoHeight: true, //autoExpandColumn:'descn', columns: [ { header: "id", sortable: true, dataIndex: 'productID' }, { header: 'name', dataIndex: 'productName', 80 }, { header: "code", sortable: true, dataIndex: 'productCode' } ], frame: true, //表格外加边框 collapsible: true, animCollapse: false }); grid.render(); });