Results 1 to 2 of 2

Thread: Application becoming undefined on page refresh

  1. #1
    Sencha User
    Join Date
    Jul 2013
    Posts
    16
    Answers
    2

    Default Application becoming undefined on page refresh

    I am currently upgrading my Ext JS app from 4.0.2 to 4.2.1, most things that broke were easy fixes but for some reason if I am on a particular page.. say "/user/edit/203" which opens the edit form page of user with id 203. If I refresh this page it will make my application become undefined even though in the 4.0.2 version of my app I set it up in the same way and it worked just fine. My app.js is called every refresh so I don't understand why it would become undefined.

    App.js
    Code:
    var TestApplication;
    
    
    Ext.onReady(function() {
       
            TestApplication = new Ext.app.Application({
                name: 'TestApp,        
                appFolder: 'jsmvc',
                controllers: ["BaseController",
                              "HomeController",
                              "UserController",],
                
                enableQuickTips: true,
                
                launch: function() {
                    Ext.create('Ext.container.Viewport', {
                        layout: 'border',
                        items: [{
                            xtype: 'container',
                            id: 'homecontainer',
                            autoDestroy: true,
                            region: 'center',
                            layout: 'fit'
                        }]
                    });
                
                }
            });
        }
    });
    Every history change I call a method that tracks the token and finds the appropriate controller for the page requested. But when the app looks for that controller from the TestApplication variable it's undefined. I'm not sure why this is happening.. does any have any ideas?

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,451
    Answers
    3997

    Default

    First thing is why are you using Ext.onReady when you should be using Ext.application:

    Code:
    Ext.application({
        name : 'TestApp',
        appFolder : 'jsmvc',
        //.....
    });
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

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
  •