<html>
<head>
<title>Ext中的Grid例子</title>
<link rel="stylesheet" type="text/css"
href="../AllRes/resources/css/ext-all.css"/>
<script type="text/javascript" src="/UploadFiles/2021-04-02/ext-
base.js"><script type="text/javascript" src="/UploadFiles/2021-04-02/ext-all.js"><script>
//ID排序
Ext.onReady(function(){
var cm = new Ext.grid.ColumnModel([
{header:'编号',dataIndex:'id',sortable:true},
{header:'名称',dataIndex:'name'},
{header:'描述',dataIndex:'descn'}
]) ;
var data = [
['1','name1','descn1'],
['2','name2','descn2'],
['3','name3','descn3'],
['4','name4','descn4'],
['5','name3','descn5']
] ;
var ds = new Ext.data.Store({
proxy:new Ext.data.MemoryProxy(data),
reader:new Ext.data.ArrayReader({},[
{name: 'id'},
{name: 'name'},
{name: 'descn'}
])
}) ;
ds.load() ;

var grid = new Ext.grid.GridPanel({
el:'grid',
ds: ds,
cm: cm
}) ;
grid.render() ;
}) ;
</script>
</head>
<body>
<div id="grid"></div>
</body>
</html>
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!