PDA

View Full Version : Panel rendering ct is null



thomson
23 Jul 2009, 1:51 AM
Hi All,
i have an html file which has the following things


<head runat="server">
<title>Demo </title>
<link href="ext-2.2/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
<script src="ext-2.2/adapter/ext/ext-base.js" type="text/javascript"></script>
<script src="ext-2.2/ext-all-debug.js" type="text/javascript"></script>
<script src="MyJs/showPanel.js" type="text/javascript"></script>
</head>
<script type ="text/javascript">
// adPanel.show();
//alert("Hi From Applet");
Ext.onReady(MyJs.app.init(), MyJs.app)

</script>
<body >
<div id="Panel-basic">

</div>
<div id="Panel-adv">

</div>
</body>

And i do have the following things in my showPanel.js


Ext.BLANK_IMAGE_URL = "../ext-2.2/resources/images/default/s.gif";
Ext.namespace('MyJs');
MyJs.app = function() {
return {
init: function() {
//alert('Application successfully initialized');
var panel = new Ext.Panel({
height: 200,
width: 200,
title: 'MyPanel',
frame: true,
renderTo: 'Panel-basic',
draggable: true,
layout: 'fit',
scope:this
});
}
}
} ();

But when i run the page it gives an error message

ct is null
onRender()(null, null)ext-all-debug.js (line 15916)
render()("Panel-basic", undefined)ext-all-debug.js (line 12454)
render()()ext-all-debug.js (line 14062)
Component()(Object height=200 width=200 title=MyPanel frame=true)ext-all-debug.js (line 12374)
getViewWidth()()ext-base.js (line 9)
getViewWidth()()ext-base.js (line 9)
getViewWidth()()ext-base.js (line 9)
init()()

When i looked in some forums i came to know that the div could not exist, but in my case this exists

Can somebody tell me what am i doing wrong here

Regards

Thomson

cracra
23 Jul 2009, 2:49 AM
Instead of



Ext.onReady(MyJs.app.init(), MyJs.app)
try



Ext.onReady(MyJs.app.init, MyJs.app)
Same code without "()"

thomson
23 Jul 2009, 2:55 AM
That worked like a charm

Thanks