Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Apr 2011
    Location
    Akhtirka, Ukraine
    Posts
    3
    Vote Rating
    0
    VaZia is on a distinguished road

      0  

    Default Can I use Ext.require for my own classes

    Can I use Ext.require for my own classes


    I am trying to require classes of my application using
    Code:
    Ext.require(['Ext.data.*','Ext.toolbar.Paging','MyApp.*']);
    I specified pathes before requiring:
    Code:
    Ext.Loader.setPath('MyApp', '../../../app/MyApp');
    And used
    HTML Code:
    <script type="text/javascript" src="http://ext4.localhost/ext-debug.js"></script>
    for include extjs 4.

    As result, all required classes that are located in 'Ext' namespace was included. But my classes, that are located in 'MyApp', not. Did I mistake, or ExtJs4 can't to load my classes by Ext.require?

    Here my project folders structure:
    Code:
    coolproject
    |-app
    ||-Ext
    |||-ux
    ||||-desktop
    |||||-...
    ||-MyApp
    |||-somenamespace
    ||||-Foo.js    // <--- I'am trying to instantiate it by new MyApp.somenamespace.Foo();
    |||-CoolClass.js         
    |-resources
    |-tests
    ||-MyApp
    |||-somenamespace
    ||||-FooTest.html    // <--- Here we are
    |-desktop.html
    |-App.js
    In the console I see:
    Uncaught ReferenceError: MyApp is not defined

  2. #2
    Ext JS Premium Member n3rd's Avatar
    Join Date
    Nov 2007
    Location
    Munich
    Posts
    72
    Vote Rating
    0
    n3rd is on a distinguished road

      0  

    Default


    Personally, I haven't used wildcard-style requires yet, but my guess is that it won't work with any namespace other than Ext for the simple reason that the loader doesn't know anything about what classes you have defined before actually loading them.

    Keep in mind that everything runs via AJAX (or ScriptTag injection) and not on a local file system. If you tell Ext to load "MyApp.*", how is it supposed to know what files to load? It can't run a "ls" and see what is there. (Well, I suppose theoretically it could if you configured your Apache accordingly ;-)

  3. #3
    Sencha User
    Join Date
    Apr 2011
    Location
    Akhtirka, Ukraine
    Posts
    3
    Vote Rating
    0
    VaZia is on a distinguished road

      0  

    Default


    Oh, thank you! You put me back on the ground ....

Similar Threads

  1. How to use Ext.require when using Ext.application
    By bzarzuela in forum Ext: Discussion
    Replies: 5
    Last Post: 3 May 2011, 2:52 AM
  2. Ext.require is not a function
    By Crocuta in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 2 May 2011, 8:06 AM
  3. Ext 4 and the Ext.require
    By pasblin in forum Ext: Discussion
    Replies: 4
    Last Post: 30 Apr 2011, 4:08 AM
  4. require on Ext JS 4
    By slmbakop in forum Ext: Discussion
    Replies: 0
    Last Post: 9 Mar 2011, 7:13 AM
  5. Builder classes/Preconfigured Classes
    By zhiliang in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 7 May 2008, 1:33 AM

Thread Participants: 1