The Gallery is deprecated. No new Gallery components may be submitted, and modifying existing components is disabled. For more information please read the Gallery Deprecation blog post. This is a static snapshot of the Gallery for archive purposes.
See 12 more by this user. Created: 10/6/11
Project: YUI 3
License: YUI BSD
YUI Version: 3.10.0
Free for use.
When using WidgetParent along with WidgetStdMod it feels a little odd that you have to adjust where WidgetParent adds its children so that it fits them into the BODY section of the StdMod extension, which is one level down from the contentBox. You can do that, there is the _childrenContainer property to specify that, but it still felt silly, I mean, what's the point of having the boundingBox containing the contentBox containing the three StdMod sections. After all, you might use the HEADER section or not, you may use the FOOTER section or not, but you are unlikely not to use the BODY section which, feels quite like the most obvious container for anything, much like the contentBox is.
So, I created this as a subclass of WidgetStdMod and changed a few methods to make the BODY and the contentBox the same thing. Also, unlike regular WidgetStdMod, the BODY section always exists instead of having to explicitly create it, a silly annoyance for a section that is hardly ever left empty.
The API docs for this extension point to the one for WidgetStdMod since there is no different in the public interface.
You simply need to use Y.StdMod instead of Y.WidgetStdMod in the list of extensions when defining a subclass of Y.Widget
YUI().use('widget','widget-parent','gallery-stdmod', function(Y) {
Y.MyWidget= Y.Base.create(
'mywidget',
Y.Widget,
[Y.StdMod, Y.WidgetParent],
{
// instance members
},
{
// static members
}
});
});
All code on this site is licensed under the BSD License unless stated otherwise.