<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css" /> <script type="text/javascript" src="extjs/adapter/ext/ext-base.js"></script> <script type="text/javascript" src="extjs/ext-all.js"></script> <script> var aData = [['11','12'],['21','22'],['31','32'],['41','42']]; Ext.onReady(function(){ var oRecord = Ext.data.Record.create([ {name: 'f1', type: 'string'}, {name: 'f2', type: 'string'} ]); var store = new Ext.data.Store({ proxy: new Ext.data.MemoryProxy(aData), reader: new Ext.data.ArrayReader({},oRecord) }); store.load(); var sm = new Ext.grid.CheckboxSelectionModel({singleSelect:false}); var columns = new Ext.grid.ColumnModel([ new Ext.grid.RowNumberer(), sm, {header: '字段1', dataIndex: 'f1'}, {header: '字段2', dataIndex: 'f2'} ]); grid = new Ext.grid.GridPanel({ title: '列表', autoHeight:true, region: 'center', loadMask: true, store: store, cm: columns, sm: sm, renderTo:'pad' }); setTimeout(function(){ grid.selModel.selectRows([0,2]); },300); }); </script> <div id='pad'></div>