一个EXT的问题,高手进。谢谢
各位同行,问你们一个EXT的问题。我写了俩个文件一个是new.js,另一个是new.html然后再eclipse上运行,但是运行后没有结果。麻烦各位大虾来指点一下new....
各位同行,问你们一个EXT的问题。我写了俩个文件一个是new.js,另一个是new.html
然后再eclipse上运行,但是运行后没有结果。麻烦各位大虾来指点一下
new.js:
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;
alert(store.getCount());
var grid = new Ext.grid.GridPanel({
renderTo : 'grid',
store : store,
cm : cm
});
new.html 文件:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" type="text/css" href="../../MyExtJs/extjs/resources/css/ext-all.css" />
<script type="text/javascript" src="../../MyExtJs/extjs/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../../MyExtJs/extjs/ext-all.js"></script>
<script type="text/javascript" src="../../test/pages/new.js"></script>
<title></title>
</head>
<body>
<div id="grid"></div>
</body>
</html> 展开
然后再eclipse上运行,但是运行后没有结果。麻烦各位大虾来指点一下
new.js:
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;
alert(store.getCount());
var grid = new Ext.grid.GridPanel({
renderTo : 'grid',
store : store,
cm : cm
});
new.html 文件:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" type="text/css" href="../../MyExtJs/extjs/resources/css/ext-all.css" />
<script type="text/javascript" src="../../MyExtJs/extjs/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../../MyExtJs/extjs/ext-all.js"></script>
<script type="text/javascript" src="../../test/pages/new.js"></script>
<title></title>
</head>
<body>
<div id="grid"></div>
</body>
</html> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询