[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/lib/yuilib/3.17.2/attribute-core/ -> attribute-core.js (summary)

The State class maintains state for a collection of named items, with a varying number of properties defined. It avoids the need to create a separate class for the item, and separate instances of these classes for each item, by storing the state in a 2 level hash table, improving performance when the number of items is likely to be large.

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

Defines 1 function

  AttributeCore()

Functions
Functions that are not part of a class:

AttributeCore(attrs, values, lazy)   X-Ref
<p>
AttributeCore provides the lightest level of configurable attribute support. It is designed to be
augmented on to a host class, and provides the host with the ability to configure
attributes to store and retrieve state, <strong>but without support for attribute change events</strong>.
</p>
<p>For example, attributes added to the host can be configured:</p>
<ul>
<li>As read only.</li>
<li>As write once.</li>
<li>With a setter function, which can be used to manipulate
values passed to Attribute's <a href="#method_set">set</a> method, before they are stored.</li>
<li>With a getter function, which can be used to manipulate stored values,
before they are returned by Attribute's <a href="#method_get">get</a> method.</li>
<li>With a validator function, to validate values before they are stored.</li>
</ul>

<p>See the <a href="#method_addAttr">addAttr</a> method, for the complete set of configuration
options available for attributes.</p>

<p>Object/Classes based on AttributeCore can augment <a href="AttributeObservable.html">AttributeObservable</a>
(with true for overwrite) and <a href="AttributeExtras.html">AttributeExtras</a> to add attribute event and
additional, less commonly used attribute methods, such as `modifyAttr`, `removeAttr` and `reset`.</p>

param: attrs {Object} The attributes to add during construction (passed through to <a href="#method_addAttrs">addAttrs</a>).
param: values {Object} The initial attribute values to apply (passed through to <a href="#method_addAttrs">addAttrs</a>).
param: lazy {boolean} Whether or not to add attributes lazily (passed through to <a href="#method_addAttrs">addAttrs</a>).



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