-
14 Jun 2012 9:19 AM #1
EXT is not defined error!!
EXT is not defined error!!
Hello All,
I get this error "Uncaught ReferenceError: Ext is not defined" followed by some indication towards .js files. I have a portlet's view.jsp which calls the main.js by "Ext.onReady(function(){ sample3();})". The main.js has links to two other .js files, namely panels.js and panels2.js. The code for one of the .js files is as follows:
Ext.application({
launch: function() {
Ext.define('trial', {
extend:'Ext.panel.Panel' ,
id:'trial',
items :[{
xtype : 'button',
text: 'Submit'
} ],
height: 200,
width: 400
})
}
});
The code for the other one is similar. On trying to display, it gives the error "EXT is not defined". I cant seem to find out the reason even after a lot of searching.
Any suggestions?
Thanks in advance!
-
14 Jun 2012 11:40 AM #2
Do you included ExtJS in your HTML file?
ex:
Regards,Code:<link rel="stylesheet" type="text/css" href="extjs4/resources/css/ext-all.css"/> <script type="text/javascript" src="extjs4/ext-all-debug.js"></script>
Scott.
-
14 Jun 2012 12:11 PM #3
Yep. I have included both the files. I have also included ext-all.js.
-
14 Jun 2012 12:24 PM #4
Are there any errors in the console when trying to load? cannot find ext-all.js error?
If you feel the path is right, are you using any dynamic loaders?
Scott.
-
14 Jun 2012 12:48 PM #5
The path is correct because there was no error initially. Only after I added the line "console.log("Blah");", I started getting the issue. Each time I restart the server, I get a different error. Now, I am getting this error:
"Uncaught TypeError: Cannot read property 'dom' of null" for "ext-all-debug.js".
-
14 Jun 2012 12:56 PM #6
That is a rendering issue .. does this run?
Scott.Code:Ext.application({ launch: function() { Ext.define('trial', { // define panel extend: 'Ext.panel.Panel', items: [{ xtype: 'button', text: 'Submit'}], height: 200, width: 400 }); Ext.create('trial', { // create panel renderTo: Ext.getBody() }); } });
-
15 Jun 2012 7:29 AM #7
I ran it once using the modified code. It runs perfectly now without any error. Although no error exists, could you please explain why this "ext is not defined" error occurs? I have come across the same error many times before and after some random code modification, it worked. Is there any specific cause other than the path issue?
Thanks!


Reply With Quote