Hybrid View

  1. #1
    Ext JS Premium Member westy's Avatar
    Join Date
    Feb 2009
    Location
    Bath, UK
    Posts
    924
    Vote Rating
    48
    westy is a jewel in the rough westy is a jewel in the rough westy is a jewel in the rough westy is a jewel in the rough

      0  

    Default Dynamic loading of controllers/models

    Dynamic loading of controllers/models


    Hi,

    Apologies if this has been asked before, but is the dynamic loader meant to support controllers and models (and possibly anything else that is 'regged' that I've not used yet)?

    We've got the loading working for classes that are Ext.defined, but you cannot seem to do the following since controllers are stored in a manager, and don't appear to be classes in their own right:
    Code:
    Ext.require('Foo.controllers.Bar', ...
    Am I missing something?

    Cheers,
    Westy

  2. #2
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,664
    Vote Rating
    7
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    as this is related to the MVC package see Tommy's note in bug thread - will work in beta3 ...
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  3. #3
    Ext JS Premium Member westy's Avatar
    Join Date
    Feb 2009
    Location
    Bath, UK
    Posts
    924
    Vote Rating
    48
    westy is a jewel in the rough westy is a jewel in the rough westy is a jewel in the rough westy is a jewel in the rough

      0  

    Default


    Can't find the thread, but good to hear it's on the radar.

    Whilst on the subject, I'd also like to be able to require a class that is named the same as a namespace that is referenced from an application.

    e.g.
    Code:
    Area1/js/Area1.js  - contains namespace data, and an init method that sets up direct providers (all in statics)
              /controllers/
              /models/
              /stores/
              /views/
    Area2/js/Area2.js
              /controllers/
              /models/
              /stores/
              /views/
    js/app.js
      /controllers/
      /models/
      /stores/
      /views/
    Can't do this currently, since if have:
    Code:
    Ext.Loader.setConfig({
        enabled: true
    });
    
    Ext.Loader.setPath('Area1', 'Area1/js');
    Ext.Loader.setPath('Area2', 'Area2/js');
    Ext.Loader.setPath('MyApplicationNS', 'js');
    You cannot Ext.require('Area1') since that tries to load 'Area1/js.js' or something, where as I'd like it to load 'Area1/js/Area1.js'.

    Hmm, maybe this is an odd use case, but it's how I'm coping with pulling common js into an application but avoiding having application classes for the other areas.

    Perhaps I'll override the loader for this special case...

    Cheers,
    Westy

  4. #4
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,664
    Vote Rating
    7
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    see the thread, maybe it answers your question partly:
    http://www.sencha.com/forum/showthre...t-work-correct
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  5. #5
    Ext JS Premium Member westy's Avatar
    Join Date
    Feb 2009
    Location
    Bath, UK
    Posts
    924
    Vote Rating
    48
    westy is a jewel in the rough westy is a jewel in the rough westy is a jewel in the rough westy is a jewel in the rough

      0  

    Default


    Nice one mate, thanks for the link.
    Wonder when beta2 is hitting?

    I don't necessarily agree with the statement in that thread that the MVC stuff is unusable until this is fixed.
    Up until about 5 minutes ago I was just script including all the files I needed, and now I'm dynamically loading stuff that is Ext.defined.
    When the controller/model fix comes along I'll remove those includes.

    Cheers,
    Westy

  6. #6
    Sencha User steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,664
    Vote Rating
    7
    steffenk has a spectacular aura about steffenk has a spectacular aura about steffenk has a spectacular aura about

      0  

    Default


    you're right with the controller stuff - but it continues with the stores.
    Maybe i didn't found the right way for now, but there has to made so much workarounds that i took the advice from Tommy to wait until beta3 for continue. (You may look into the thread mentioned there, here in help forum)
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

Similar Threads

  1. Loading Multiple Models by Association using Store
    By babar.sajjad in forum Sencha Touch 1.x: Discussion
    Replies: 3
    Last Post: 31 Mar 2011, 6:56 AM
  2. Model: Lazy loading associated models
    By Mithon in forum Ext: Discussion
    Replies: 3
    Last Post: 23 Mar 2011, 11:16 AM
  3. [FIXED][PR4] Dependency loading with models
    By xcambar in forum Ext:Bugs
    Replies: 2
    Last Post: 21 Mar 2011, 4:17 AM
  4. Questions about Models, Stores, and dynamic Lists
    By jonathanstark in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 10 Aug 2010, 8:54 AM

Thread Participants: 1

Tags for this Thread