-
6 Apr 2011 3:01 AM #1
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:
Am I missing something?Code:Ext.require('Foo.controllers.Bar', ...
Cheers,
Westy
-
6 Apr 2011 3:10 AM #2
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
energlobe.de - german online magazine
-
6 Apr 2011 3:59 AM #3
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.
Can't do this currently, since if have: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/
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'.Code:Ext.Loader.setConfig({ enabled: true }); Ext.Loader.setPath('Area1', 'Area1/js'); Ext.Loader.setPath('Area2', 'Area2/js'); Ext.Loader.setPath('MyApplicationNS', '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
-
6 Apr 2011 4:34 AM #4
see the thread, maybe it answers your question partly:
http://www.sencha.com/forum/showthre...t-work-correctvg Steffen
--------------------------------------
Release Manager of TYPO3 4.5
energlobe.de - german online magazine
-
6 Apr 2011 5:08 AM #5
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 Apr 2011 5:38 AM #6
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
energlobe.de - german online magazine
Similar Threads
-
Loading Multiple Models by Association using Store
By babar.sajjad in forum Sencha Touch 1.x: DiscussionReplies: 3Last Post: 31 Mar 2011, 6:56 AM -
Model: Lazy loading associated models
By Mithon in forum Ext: DiscussionReplies: 3Last Post: 23 Mar 2011, 11:16 AM -
[FIXED][PR4] Dependency loading with models
By xcambar in forum Ext:BugsReplies: 2Last Post: 21 Mar 2011, 4:17 AM -
Questions about Models, Stores, and dynamic Lists
By jonathanstark in forum Sencha Touch 1.x: DiscussionReplies: 2Last Post: 10 Aug 2010, 8:54 AM


Reply With Quote