[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/lib/yuilib/3.17.2/base-base/ -> base-base-debug.js (summary)

The base module provides the Base class, which objects requiring attribute and custom event support can extend. The module also provides two ways to reuse code - It augments Base with the Plugin.Host interface which provides plugin support and also provides the BaseCore.build method which provides a way to build custom classes using extensions.

File Size: 191 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 function

  Base()

Functions
Functions that are not part of a class:

Base()   X-Ref
<p>
A base class which objects requiring attributes and custom event support can
extend. Base also handles the chaining of initializer and destructor methods across
the hierarchy as part of object construction and destruction. Additionally, attributes configured
through the static <a href="#property_ATTRS">ATTRS</a> property for each class
in the hierarchy will be initialized by Base.
</p>

<p>
**NOTE:** Prior to version 3.11.0, ATTRS would get added a class at a time. That is,
Base would loop through each class in the hierarchy, and add the class' ATTRS, and
then call it's initializer, and move on to the subclass' ATTRS and initializer. As of
3.11.0, ATTRS from all classes in the hierarchy are added in one `addAttrs` call before
any initializers are called. This fixes subtle edge-case issues with subclass ATTRS overriding
superclass `setter`, `getter` or `valueFn` definitions and being unable to get/set attributes
defined by the subclass. This order of operation change may impact `setter`, `getter` or `valueFn`
code which expects a superclass' initializer to have run. This is expected to be rare, but to support
it, Base supports a `_preAddAttrs()`, method hook (same signature as `addAttrs`). Components can
implement this method on their prototype for edge cases which do require finer control over
the order in which attributes are added (see widget-htmlparser).
</p>

<p>
The static <a href="#property_NAME">NAME</a> property of each class extending
from Base will be used as the identifier for the class, and is used by Base to prefix
all events fired by instances of that class.
</p>

param: {Object} config Object with configuration property name/value pairs. The object can be



Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1