救命啦,小弟ext新手,页面总是报'this.el.dom'为空或不是对象!
这是我的文件,我把它贴出来,希望各位大侠能尽快回复,谢啦!<!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN"...
这是我的文件,我把它贴出来,希望各位大侠能尽快回复,谢啦!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>test2.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../ext/resources/css/ext-all.css"
type="text/css"></link>
<script type="text/javascript" src="../ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../ext/ext-all.js"></script>
<script type="text/javascript" src="../ext/ext-all-debug.js"></script>
<script type="text/javascript"
src="../ext/build/locale/ext-lang-zh_CN.js"></script>
<script>
var cm = new Ext.grid.ColumnModel([
{header:'编号',dataIndex:'id'},
{header:'名称',dataIndex:'name'},
{header:'描述',dataIndex:'describe'}
]);
var data = [
['1','name1','describe1'],
['2','name2','describe2'],
['3','name3','describe3'],
['4','name4','describe4'],
['5','name5','describe5'],
['6','name6','describe6'],
['7','name7','describe7'],
['8','name8','describe8'],
['9','name9','describe9'],
['10','name10','describe10']
];
var ds = new Ext.data.Store({
proxy:new Ext.data.MemoryProxy(data),
reader:new Ext.data.ArrayReader(
{},
[
{name:'id',mapping:0},
{name:'name',mapping:1},
{name:'describe',mapping:2}
]
)
});
ds.load();
var grid = new Ext.grid.GridPanel({
el: 'grid',
ds: ds,
cm: cm
});
grid.render();
</script>
</head>
<body>
<h1>
My Grid
</h1>
<div id="grid"></div>
</body>
</html>
本人非常感谢你的回答,如果改为grid.render('grid');就会报"dom" 为空或不是对象,各位大侠再帮我检查一下,好吗? 展开
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>test2.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../ext/resources/css/ext-all.css"
type="text/css"></link>
<script type="text/javascript" src="../ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../ext/ext-all.js"></script>
<script type="text/javascript" src="../ext/ext-all-debug.js"></script>
<script type="text/javascript"
src="../ext/build/locale/ext-lang-zh_CN.js"></script>
<script>
var cm = new Ext.grid.ColumnModel([
{header:'编号',dataIndex:'id'},
{header:'名称',dataIndex:'name'},
{header:'描述',dataIndex:'describe'}
]);
var data = [
['1','name1','describe1'],
['2','name2','describe2'],
['3','name3','describe3'],
['4','name4','describe4'],
['5','name5','describe5'],
['6','name6','describe6'],
['7','name7','describe7'],
['8','name8','describe8'],
['9','name9','describe9'],
['10','name10','describe10']
];
var ds = new Ext.data.Store({
proxy:new Ext.data.MemoryProxy(data),
reader:new Ext.data.ArrayReader(
{},
[
{name:'id',mapping:0},
{name:'name',mapping:1},
{name:'describe',mapping:2}
]
)
});
ds.load();
var grid = new Ext.grid.GridPanel({
el: 'grid',
ds: ds,
cm: cm
});
grid.render();
</script>
</head>
<body>
<h1>
My Grid
</h1>
<div id="grid"></div>
</body>
</html>
本人非常感谢你的回答,如果改为grid.render('grid');就会报"dom" 为空或不是对象,各位大侠再帮我检查一下,好吗? 展开
1个回答
网易云信
2023-12-06 广告
2023-12-06 广告
UIkit是一套轻量级、模块化且易于使用的开源UI组件库,由YOOtheme团队开发。它提供了丰富的界面元素,包括按钮、表单、表格、对话框、滑块、下拉菜单、选项卡等等,适用于各种类型的网站和应用程序。UIkit还支持响应式设计,可以根据不同...
点击进入详情页
本回答由网易云信提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询