<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8"><link rel="stylesheet" type="text/css" href="Ext/extjs4.0/resources/css/ext-all.css"><script type="text/javascript" src="Ext/extjs4.0/bootstrap.js"></script><script type="text/javascript" src="Ext/extjs4.0/ext-all.js"></script><script type="text/javascript">Ext.onReady(function(){var cm = new Ext.grid.ColumnModel([{header:'曲目编号', dataIndex:'music_id'},{header:'曲目名称', dataIndex:'music_name'},{header:'作曲家', dataIndex:'composer'},{header:'演奏乐器', dataIndex:'instrument'}]);var data = [['001', 'Oasis', 'Kotaro Oshio', '吉他'],['002', 'Classical Gas', 'Tommy.Emmanuel','吉他'],['003', 'THIS WAY', 'Depapepe', '吉他']];var store = new Ext.data.Store({proxy:new Ext.data.MemoryProxy(data),reader:new Ext.data.ArrayReader([{name:'music_id'},{name:'music_name'},{name:'composer'},{name:'instrument'}])});store.load();var gridPanel = new Ext.grid.GridPanel({renderTo:'gridPanel',autoHeight:true,store:store,cm:cm});});</script></head><body><div id="gridPanel"></div></body></html>
2 回答
倚天杖
TA贡献1828条经验 获得超3个赞
//不是很确切地说 应该用GridPanel替代ColumnModel吧 要不然光写这句就要报错了 |
var cm = new Ext.grid.GridPanel([ {header: '曲目编号' , dataIndex: 'music_id' }, {header: '曲目名称' , dataIndex: 'music_name' }, {header: '作曲家' , dataIndex: 'composer' }, {header: '演奏乐器' , dataIndex: 'instrument' } ]); |
- 2 回答
- 0 关注
- 530 浏览
添加回答
举报
0/150
提交
取消