<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<title>面板代码</title>
<link type="text/css" rel="stylesheet" href="ext-4.1.1a/resources/css/ext-all.css">
<script type="text/javascript" src="ext-4.1.1a/ext-all.js"></script>
<script type="text/javascript" src="ext-4.1.1a/locale/ext-lang-zh_CN.js"></script>
<script type="text/javascript">
/*
Ext.onReady(
function (){
new Ext.Panel({
renderTo:'zhanghongtu',
title:"面板头部header",
height:200,
html:'<h1>面板主区域</h1>',
tbar:[{text:'顶部工具topToolbar'}]
});
});
*/
Ext.onReady(
function(){
new Ext.Panel({
renderTo: "hello",
title:"面板头部header",
width:300,
height:200,
html:'<h1>面板主区域</h1>',
tbar:[{text:'顶部工具栏topToolbar'}],
bbar:[{text:'底部工具栏bottomToolbar'}],
buttons:[{text:"按钮位于footer"}]
});
}
);
</script>
<body>
<div id="hello"></div>
</body>
</html>
一直抛出dom为空或者不是对象的问题,是因为 renderTo: "hello"语句,指向的是id=hello的div,如果没有id为hello的div自然会出现dom为空或者不是对象的错误.