Results 1 to 7 of 7

Thread: EXT is not defined error!!

  1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    61
    Vote Rating
    2
      0  

    Default 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!

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,389
    Vote Rating
    498
      0  

    Default

    Do you included ExtJS in your HTML file?

    ex:
    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>
    Regards,
    Scott.

  3. #3
    Sencha User
    Join Date
    May 2012
    Posts
    61
    Vote Rating
    2
      0  

    Default

    Yep. I have included both the files. I have also included ext-all.js.

  4. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,389
    Vote Rating
    498
      0  

    Default

    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.

  5. #5
    Sencha User
    Join Date
    May 2012
    Posts
    61
    Vote Rating
    2
      0  

    Default

    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".

  6. #6
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,389
    Vote Rating
    498
      0  

    Default

    That is a rendering issue .. does this run?

    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()
            });    
        }
    });?
    Scott.

  7. #7
    Sencha User
    Join Date
    May 2012
    Posts
    61
    Vote Rating
    2
      0  

    Default

    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!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •