日期:2014-05-17 浏览次数:20684 次
Ext.onReady(function(){ var cm = new Ext.grid.ColumnModel([ {header:'编号',dataIndex:'id'}, {header:'名称',dataIndex:'name'}, {header:'描述',dataIndex:'descn'} ]); var data = [ ['1','name1','descn1'], ['2','name2','descn2'], ['3','name3','descn3'], ['4','name4','descn4'], ['5','name5','descn5'] ]; var store = new Ext.data.Store({ proxy:new Ext.data.MemoryProxy(data), reader:new Ext.data.ArrayReader([ {name:'id'}, {name:'name'}, {name:'descn'} ]) }); store.load(); var grid = new Ext.grid.GridPanel({ renderTo:'grid', store:store, cm:cm }); });
<html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css"> <script type="text/javascript" src="../../adapter/ext/ext-base.js"></script> <script type="text/javascript" src="../../ext-all-debug.js"></script> <script type="text/javascript" src="Hello.js"></script> <script type="text/javascript" src="../../source/locale/ext-lang-zh_CN.js"></script> </head> <body> <div id='grid'></div> </body> </html>