第一种方法必须在页面上设置div的宽度<div id="grid-example" width="90%"></div>
// create the Grid var grid = new Ext.grid.GridPanel({ store: store, columns: [ {id:'company',header: 'Company', width: 160, sortable: true, dataIndex: 'company'} ], stripeRows: true, autoExpandColumn: 'company', height: 350, //第一种方法:width: Ext.get("grid-example").getWidth(), //第二种方法 bodyStyle:'width:100%', title: 'Array Grid', // config options for stateful behavior stateful: true, stateId: 'grid' });