首页 >web前端 >js教程 >初学JavaScript_03(ExtJs Grid的简单使用)_javascript技巧

初学JavaScript_03(ExtJs Grid的简单使用)_javascript技巧

WBOY
WBOY原创
2016-05-16 19:00:071054浏览


Ext中的Grid例子
href="../AllRes/resources/css/ext-all.css"/>


<script> <BR>//ID排序 <BR>Ext.onReady(function(){ <BR>var cm = new Ext.grid.ColumnModel([ <BR>{header:'编号',dataIndex:'id',sortable:true}, <BR>{header:'名称',dataIndex:'name'}, <BR>{header:'描述',dataIndex:'descn'} <BR>]) ; <BR>var data = [ <BR>['1','name1','descn1'], <BR>['2','name2','descn2'], <BR>['3','name3','descn3'], <BR>['4','name4','descn4'], <BR>['5','name3','descn5'] <BR>] ; <BR>var ds = new Ext.data.Store({ <BR>proxy:new Ext.data.MemoryProxy(data), <BR>reader:new Ext.data.ArrayReader({},[ <BR>{name: 'id'}, <BR>{name: 'name'}, <BR>{name: 'descn'} <BR>]) <BR>}) ; <BR>ds.load() ; <br><br>var grid = new Ext.grid.GridPanel({ <BR>el:'grid', <BR>ds: ds, <BR>cm: cm <BR>}) ; <BR>grid.render() ; <BR>}) ; <BR></script>




声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn