| Page 1 of 1 | [ 3 posts ] |
|
Hello,
Can anyone point me to the 'interface/API' that the extension objects must adhere to in the array argument for Y.Base.create(...,[extensions],.....)? From the code sample here (http://yuilibrary.com/yui/docs/base/#create), I can somewhat get a gist of what's needed, but I can't find it explicitly documented. On a side note, I found it interesting that the Resizable extension class is a function and has properties... Code: function Resizable() { this._initResizable(); } Resizable.ATTRS = { handles : { ... }, constrain : { ... } }; which results in the fact that if I changed the code around to make ATTRS a part of 'this', then it wont work! Code: function Resizable() { this._initResizable(); this.ATTRS = { // THIS WILL NOT WORK! Somewhat confused about why it wont work... handles : { ... }, constrain : { ... } }; } Thanks. |
|
Daniel,
There isn't any explicit requirement for extensions beyond them being function objects. That said, there is some extra stuff they can leverage, like changed lifecycle via implementing `initializer()` and `destructor()` functions, and specifying `ATTRS` either as overriding existing Attribute configurations or adding new Attributes. |
|
`ATTRS` are always defined statically on the function, whether it's a class or extension.
|
| Page 1 of 1 | [ 3 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