7 Nov 2011 2:23 PM #1
Autoloading and objects. (autoloading objects into namespaces)
Here's the broken-down scenario, I've got a URL class in Ext. I wish to create a number of URL objects.
Right now, I'm just trying to figure out the best method for structuring everything and ideally supporting autoloading. The major issue I'm seeing is autoloading is for loading [object] classes and not the final objects into namespaces.
I could easily create a bunch of JSON objects and load manually, but I feel there must be a better way.
Does anyone have any suggestions or examples for handling and structuring [static] objects?
Even some various MVC patterns may be of some help, I understand the ExtJS MVC but that is not what I am looking for with this current project.
8 Nov 2011 9:51 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
ComponentLoader has a load event just like a Store that you could put the response onto a namespace. Or you have a callback function you can pass to ComponentLoader.Mitchell Simoens @LikelyMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services email@example.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
10 Nov 2011 5:33 PM #3
also trying to use autoload in mvc pattern
I am trying to do something similar. I want to make a navigation widget that provides links with hash style hrefs (/resource/#!/widget). I would like to click on a link and load the corresponding widget (similar to how tabs work). I have created a view class that defines a container and it's items. I've tried using autoCreateViewport, autoRender, and autoShow in my views but the page just loads blank.
forum thread here
I'm confused as to how the the ComponentLoader can be used in an MVC application like the example here.
If you download and run the example code everything seems to load without a loader configuration.
Any additional thoughts or discussion on this would be much appreciated.
10 Nov 2011 7:18 PM #4
I fixed my problem. Maybe my example code will help you.
I'm not sure it's useful to you but I'm sharing it here just in case you need it.
Forum thread here