| Page 1 of 1 | [ 6 posts ] |
|
I have set up a number of 'common' and 're-usable' classes in a single file YUI().add file, but when I try and create an instance of one of the classes in another YUI.use() file that requires this file it fails.
Does the yui.add system only support the registering of one class? In my yui.add I have something like... Y.class1 = Y.Base.create(...); Y.class2 = Y.Base.create(...); etc.. Then in another file that 'uses' this file var class1 = new Y.class1() fails. any guidance appreciated, if the above is misunderstood usage, and I wanted to common out a whole heap of multiple classes, say view classes or model classes, into a single re-usable file, how would I best do this? Regards Richard. |
|
You can define as many things as you want in a YUI.add statement. Most likely, the module you've defined isn't being included, or a critical dependency is missing when your YUI.add-ed module is executed.
Can you post more about what you're doing? Also: an example of attaching many things to Y from a YUI.add statement. |
|
I think that the issue you're having is that the dependencies aren't loading correctly prior to your application code being executed. It appears that sometimes Y.Artist isn't defined, and sometimes Y.artistsView. The nondeterminism of this indicates to me that the closures that define these classes aren't working correctly.
I would plug a debugger into those files and use the unminified YUI source with a filter of "DEBUG", that should give you more insight into what's going wrong. |
|
yes, but if the files that contain those class definitions are both included in the YUI().use shouldn't that ensure that they are loaded before function(Y)?
|
|
actually I have an idea, one of these 'include' files refernces the other without declaring the dependence. I will try to track this down now.
|
| Page 1 of 1 | [ 6 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group