Ext.grid.GridPanel 表格
<link rel="stylesheet" type="text/css" href="extjs2.3/resources/css/ext-all.css" />
<script type="text/javascript" src="extjs2.3/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="extjs2.3/ext-all.js"></script>
<script type="text/javascript">
Ext.onReady(function(){
//数据存储器
var store=new Ext.data.JsonStore({
url:"demo.action?method=getInfo",
root:"result",
fields:["id","name","homepage"]
});
//数据列映射
var colm=new Ext.grid.ColumnModel([
{header:"id",dataIndex:"id",sortable:true},
{header:"名称",dataIndex:"name",sortable:true},
{header:"网址",dataIndex:"homepage"}
]);
//表格
new Ext.grid.GridPanel({
renderTo:"grid",
title:"表格grid",
height:150,
width:600,
cm:colm,
store:store,
autoExpandColumn:2
});
});
</script>
?
<div id="grid"></div>