1. #1
    Sencha User
    Join Date
    Sep 2011
    Posts
    1
    Vote Rating
    0
    ouewqa is on a distinguished road

      0  

    Default HELP ! app is undefined, app is application name

    HELP ! app is undefined, app is application name


    Ext.application({
    name: 'app',
    launch: function(){
    console.log(app);
    }
    });


    console: app is undefined

  2. #2
    Sencha User SunboX's Avatar
    Join Date
    Mar 2010
    Posts
    238
    Vote Rating
    28
    SunboX has a spectacular aura about SunboX has a spectacular aura about

      0  

    Exclamation


    You have to add a Controller!

    Code:
    Ext.Loader.setConfig({ enabled: true });
    
    Ext.application({
        name: 'App',
        
        // the controller will take care of creating the view        
        controllers: ['AppController'],
        
        launch: function() {              
            console.log('app launch');
            console.log(App);
        }
    });
    greetings Sunny

  3. #3
    Sencha User jep's Avatar
    Join Date
    Sep 2010
    Posts
    862
    Vote Rating
    21
    jep will become famous soon enough jep will become famous soon enough

      0  

    Default


    I think part of the confusion is that the docs haven't yet been updated for that.

  4. #4
    Sencha User jep's Avatar
    Join Date
    Sep 2010
    Posts
    862
    Vote Rating
    21
    jep will become famous soon enough jep will become famous soon enough

      0  

    Default


    Also, when I run your code with 2.0 pr 1, I get:

    Uncaught Error: [Ext.Loader] Failed loading 'app/controller/AppController.js', please verify that the file exists

    So no idea how this is all supposed to work.

  5. #5
    Sencha User SunboX's Avatar
    Join Date
    Mar 2010
    Posts
    238
    Vote Rating
    28
    SunboX has a spectacular aura about SunboX has a spectacular aura about

      0  

    Default


    Here´s a simple "Helleo World" example:

    https://github.com/FrancisShanahan/S...2MVCHelloworld

    greetings Sunny

  6. #6
    Sencha User jep's Avatar
    Join Date
    Sep 2010
    Posts
    862
    Vote Rating
    21
    jep will become famous soon enough jep will become famous soon enough

      0  

    Default


    That's one of the most complicated "Hello World" examples I've ever seen.

    I really hope this isn't what is expected of a "simple" Sencha app. If so, this is a big departure from previous versions. I think the whole MVC thing is overkill in many applications.

    FYI, here's how I would work around the app variable not being defined in the original example:

    Code:
    Ext.application({
      name: 'app',
      launch: function(){
        app = this;
        console.log(app);
      }
    });

  7. #7
    Sencha User SunboX's Avatar
    Join Date
    Mar 2010
    Posts
    238
    Vote Rating
    28
    SunboX has a spectacular aura about SunboX has a spectacular aura about

      0  

    Default


    In my opinion it's easy. Even small Apps will benefit from this MVC architecture. You can't get an app without a bit of work and learning. ;o)

    greetings Sunny

  8. #8
    Sencha User jep's Avatar
    Join Date
    Sep 2010
    Posts
    862
    Vote Rating
    21
    jep will become famous soon enough jep will become famous soon enough

      0  

    Default


    I think you've entirely missed the point of a "hello, world" app. If this is the "simple" way to learn ST, it's use will become much more limited and it will wither on the vine.

    Luckily, I don't believe that is the case. MVC is simply not always appropriate. If it was, nobody would ever create stuff that wasn't MVC.

  9. #9
    Sencha User SunboX's Avatar
    Join Date
    Mar 2010
    Posts
    238
    Vote Rating
    28
    SunboX has a spectacular aura about SunboX has a spectacular aura about

      0  

    Default


    Yes, there are non MVC Apps inside the example folder of the ST2-PR1 download. But if you get it working, you should think of MVC. It's difficult at the beginning but will get easier the more complex your app get's.

    Greetings Sunny

  10. #10
    Sencha User jep's Avatar
    Join Date
    Sep 2010
    Posts
    862
    Vote Rating
    21
    jep will become famous soon enough jep will become famous soon enough

      0  

    Default


    The problem isn't that there are no non-MVC examples. The problem is, as stated in the original post, Ext.application seems to not be filling in the "name" field with the object instance as it did prior to 2.0. I think this is probably an oversight (at least in non-MVC apps).

Thread Participants: 3

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi