YUI recommends YUI 3.

YUI 2 has been deprecated since 2011. This site acts as an archive for files and documentation.

Yahoo! UI Library

element  2.8.1

Yahoo! UI Library > element > YAHOO.util.AttributeProvider
Search:
 
Filters

Class YAHOO.util.AttributeProvider - uses YAHOO.util.EventProvider

Provides and manages YAHOO.util.Attribute instances

Properties

_configs - private {Object}

A key-value map of Attribute configurations

Methods

configureAttribute

void configureAttribute ( key , map , init )
Sets or updates an Attribute instance's properties.
Parameters:
key <String> The attribute's name.
map <Object> A key-value map of attribute properties
init <Boolean> Whether or not this should become the intial config.
Deprecated Use setAttributeConfig

fireBeforeChangeEvent

void fireBeforeChangeEvent ( key , e )
Fires the attribute's beforeChange event.
Parameters:
key <String> The attribute's name.
e <Obj> The event object to pass to handlers.

fireChangeEvent

void fireChangeEvent ( key , e )
Fires the attribute's change event.
Parameters:
key <String> The attribute's name.
e <Obj> The event object to pass to the handlers.

get

Any get ( key )
Returns the current value of the attribute.
Parameters:
key <String> The attribute whose value will be returned.
Returns: Any
The current value of the attribute.

getAttributeConfig

private object getAttributeConfig ( key )
Returns the attribute's properties.
Parameters:
key <String> The attribute's name
Returns: object
A key-value map containing all of the attribute's properties.

getAttributeKeys

Array getAttributeKeys ( )
Returns an array of attribute names.
Returns: Array
An array of attribute names.

refresh

void refresh ( key , silent )
Sets the attribute's value to its current value.
Parameters:
key <String | Array> The attribute(s) to refresh
silent <Boolean> Whether or not to suppress change events

register

void register ( key , map )
Adds an Attribute to the AttributeProvider instance.
Parameters:
key <String> The attribute's name
map <Object> A key-value map containing the attribute's properties.
Deprecated Use setAttributeConfig

resetAttributeConfig

private void resetAttributeConfig ( key )
Resets an attribute to its intial configuration.
Parameters:
key <String> The attribute's name.

resetValue

Boolean resetValue ( key , silent )
Resets the specified attribute's value to its initial value.
Parameters:
key <String> The name of the attribute
silent <Boolean> Whether or not to suppress change events
Returns: Boolean
Whether or not the value was set

set

Boolean set ( key , value , silent )
Sets the value of a config.
Parameters:
key <String> The name of the attribute
value <Any> The value to apply to the attribute
silent <Boolean> Whether or not to suppress change events
Returns: Boolean
Whether or not the value was set.

setAttributeConfig

void setAttributeConfig ( key , map , init )
Sets or updates an Attribute instance's properties.
Parameters:
key <String> The attribute's name.
map <Object> A key-value map of attribute properties
init <Boolean> Whether or not this should become the intial config.

setAttributes

void setAttributes ( map , silent )
Sets multiple attribute values.
Parameters:
map <Object> A key-value map of attributes
silent <Boolean> Whether or not to suppress change events


Copyright © 2010 Yahoo! Inc. All rights reserved.