Yahoo! UI Library

TreeView Widget 

Yahoo! UI Library > treeview > YAHOO.widget.TreeView

Class YAHOO.widget.TreeView - uses YAHOO.util.EventProvider

Contains the tree view state data and the root node.

Constructor

YAHOO.widget.TreeView ( id )
Parameters:
id <string|HTMLElement> The id of the element, or the element itself that the tree will be inserted into.

Properties

_animCount - private int

The current number of animations that are executing

_collapseAnim - private string

The animation to use for collapsing children, if any

_el - private object

The host element for this tree

_expandAnim - private string

The animation to use for expanding children, if any

_nodes - private Node[]

Flat collection of all nodes in this tree

id - String

The id of tree container element

locked - boolean

We lock the tree control while waiting for the dynamic loader to return

maxAnim - int

The maximum number of animations to run at one time.

YAHOO.widget.TreeView.counter - private static object

Counter for generating a new unique element id

YAHOO.widget.TreeView.nodeCount - static int

Count of all nodes in all trees

YAHOO.widget.TreeView.trees - private static Array

Global cache of tree instances

Methods

_deleteNode

private void _deleteNode ( )
Deletes the node and recurses children
Returns: void

animateCollapse

boolean animateCollapse ( el , node )
Perform the collapse animation if configured, or just show the element if not configured or too many animations are in progress
Parameters:
el <HTMLElement> the element to animate
node <YAHOO.util.Node> the node that was expanded
Returns: boolean
true if animation could be invoked, false otherwise

animateExpand

boolean animateExpand ( el , node )
Perform the expand animation if configured, or just show the element if not configured or too many animations are in progress
Parameters:
el <HTMLElement> the element to animate
node <YAHOO.util.Node> the node that was expanded
Returns: boolean
true if animation could be invoked, false otherwise

collapseAll

void collapseAll ( )
Collapses all expanded child nodes in the entire tree.
Returns: void

collapseComplete

void collapseComplete ( )
Function executed when the collapse animation completes
Returns: void

draw

void draw ( )
Renders the tree boilerplate and visible nodes
Returns: void

expandAll

void expandAll ( )
Expands all child nodes. Note: this conflicts with the "multiExpand" node property. If expand all is called in a tree with nodes that do not allow multiple siblings to be displayed, only the last sibling will be expanded.
Returns: void

expandComplete

void expandComplete ( )
Function executed when the expand animation completes
Returns: void

generateId

private void generateId ( )
Generates an unique id for an element if it doesn't yet have one
Returns: void

getEl

HTMLElement getEl ( )
Returns the tree's host element
Returns: HTMLElement
the host element

getNodeByIndex

Node getNodeByIndex ( nodeIndex )
Returns a node in the tree that has the specified index (this index is created internally, so this function probably will only be used in html generated for a given node.)
Parameters:
nodeIndex <int> the index of the node wanted
Returns: Node
the node with index=nodeIndex, null if no match

getNodeByProperty

Node getNodeByProperty ( property , value )
Returns a node that has a matching property and value in the data object that was passed into its constructor.
Parameters:
property <object> the property to search (usually a string)
value <object> the value we want to find (usuall an int or string)
Returns: Node
the matching node, null if no match

getNodesByProperty

Array getNodesByProperty ( property , value )
Returns a collection of nodes that have a matching property and value in the data object that was passed into its constructor.
Parameters:
property <object> the property to search (usually a string)
value <object> the value we want to find (usuall an int or string)
Returns: Array
the matching collection of nodes, null if no match

getRoot

Node getRoot ( )
Returns the root node of this tree
Returns: Node
the root node

init

private void init ( )
Initializes the tree
Returns: void

onCollapse

void onCollapse ( node )
Abstract method that is executed when a node is collapsed.
Parameters:
node <Node> the node that was collapsed.
Returns: void
Deprecated use treeobj.subscribe("collapse") instead

onExpand

void onExpand ( node )
Abstract method that is executed when a node is expanded
Parameters:
node <Node> the node that was expanded
Returns: void
Deprecated use treeobj.subscribe("expand") instead

popNode

void popNode ( the )
Removes the node from the tree, preserving the child collection to make it possible to insert the branch into another part of the tree, or another tree.
Parameters:
the <Node> node to remove
Returns: void

regNode

private void regNode ( node )
Nodes register themselves with the tree instance when they are created.
Parameters:
node <Node> the node to register
Returns: void

removeChildren

void removeChildren ( node )
Deletes this nodes child collection, recursively. Also collapses the node, and resets the dynamic load flag. The primary use for this method is to purge a node and allow it to fetch its data dynamically again.
Parameters:
node <Node> the node to purge
Returns: void

removeNode

boolean removeNode ( The , autoRefresh )
Removes the node and its children, and optionally refreshes the branch of the tree that was affected.
Parameters:
The <Node> node to remove
autoRefresh <boolean> automatically refreshes branch if true
Returns: boolean
False is there was a problem, true otherwise.

setCollapseAnim

void setCollapseAnim ( the )
Sets up the animation for collapsing children
Parameters:
the <string> type of animation (acceptable values defined in YAHOO.widget.TVAnim)
Returns: void

setDynamicLoad

void setDynamicLoad ( fnDataLoader , iconMode )
Configures this tree to dynamically load all child data
Parameters:
fnDataLoader <function> the function that will be called to get the data
iconMode <int> configures the icon that is displayed when a dynamic load node is expanded the first time without children. By default, the "collapse" icon will be used. If set to 1, the leaf node icon will be displayed.
Returns: void

setExpandAnim

void setExpandAnim ( type )
Sets up the animation for expanding children
Parameters:
type <string> the type of animation (acceptable values defined in YAHOO.widget.TVAnim)
Returns: void

setUpLabel

void setUpLabel ( oData )
Sets up the node label
Parameters:
oData <object> string containing the label, or an object with a label property
Returns: void

toString

string toString ( )
TreeView instance toString
Returns: string
string representation of the tree

YAHOO.widget.TreeView.addHandler

static void YAHOO.widget.TreeView.addHandler ( el , sType , fn )
Add a DOM event
Parameters:
el <object> the elment to bind the handler to
sType <string> the type of event handler
fn <function> the callback to invoke
Returns: void

YAHOO.widget.TreeView.getNode

static Node YAHOO.widget.TreeView.getNode ( treeId , nodeIndex )
Global method for getting a node by its id. Used in the generated tree html.
Parameters:
treeId <String> the id of the tree instance
nodeIndex <String> the index of the node to return
Returns: Node
the node instance requested, null if not found

YAHOO.widget.TreeView.getTree

static TreeView YAHOO.widget.TreeView.getTree ( treeId )
Global method for getting a tree by its id. Used in the generated tree html.
Parameters:
treeId <String> the id of the tree instance
Returns: TreeView
the tree instance requested, null if not found.

YAHOO.widget.TreeView.preload

static void YAHOO.widget.TreeView.preload ( prefix )
Attempts to preload the images defined in the styles used to draw the tree by rendering off-screen elements that use the styles.
Parameters:
prefix <string> the prefix to use to generate the names of the images to preload, default is ygtv
Returns: void

YAHOO.widget.TreeView.removeHandler

static void YAHOO.widget.TreeView.removeHandler ( el , sType , fn )
Remove a DOM event
Parameters:
el <object> the elment to bind the handler to
sType <string> the type of event handler
fn <function> the callback to invoke
Returns: void

Events

animComplete

animComplete ( node )
When animation is enabled, this event fires when the animation completes
Parameters:
node <YAHOO.widget.Node> the node that is expanding/collapsing

animStart

animStart ( node )
When animation is enabled, this event fires when the animation starts
Parameters:
node <YAHOO.widget.Node> the node that is expanding/collapsing

collapse

collapse ( node )
Fires when a node is going to be collapsed. Return false to stop the collapse.
Parameters:
node <YAHOO.widget.Node> the node that is collapsing

collapseComplete

collapseComplete ( node )
Fires after a node is successfully collapsed. This event will not fire if the "collapse" event was cancelled.
Parameters:
node <YAHOO.widget.Node> the node that was collapsed

expand

expand ( node )
Fires when a node is going to be expanded. Return false to stop the collapse.
Parameters:
node <YAHOO.widget.Node> the node that is expanding

expandComplete

expandComplete ( node )
Fires after a node is successfully expanded. This event will not fire if the "expand" event was cancelled.
Parameters:
node <YAHOO.widget.Node> the node that was expanded

labelClick

labelClick ( node )
Custom event that is fired when the text node label is clicked. The custom event is defined on the tree instance, so there is a single event that handles all nodes in the tree. The node clicked is provided as an argument
Parameters:
node <YAHOO.widget.Node> the node clicked


Copyright © 2006 Yahoo! Inc. All rights reserved.
Download Mp3/Mp3 MusicTop Chartsdownload Guns N\ Roses music lyricdownload The Raconteurs music lyricdownload Nina Simone music lyricdownload The Cure music lyricdownload Pendulum music lyricdownload Barenaked Ladies music lyricdownload Spiritualized music lyricdownload The Beach Boys music lyricdownload Natasha Bedingfield music lyricdownload Def Leppard music lyricdownload Gabriella Cilmi music lyricdownload Red Hot Chili Peppers music lyricdownload Toby Keith music lyricdownload Nickelback music lyricdownload Flobots music lyricdownload Tom Waits music lyricdownload Sara Bareilles music lyricdownload Kanye West music lyricdownload Eric Clapton music lyricdownload Fleetwood Mac music lyricdownload Stevie Wonder music lyricdownload Elton John music lyricdownload Fleet Foxes music lyricdownload Sam Sparro music lyricdownload Depeche Mode music lyricdie

die

soon state

state

joy sleep

sleep

neighbor drink

drink

numeral mix

mix

company month

month

father dollar

dollar

sell sheet

sheet

money produce

produce

nature shell

shell

sat twenty

twenty

behind notice

notice

are less

less

ship interest

interest

complete child

child

far fig

fig

the instant

instant

house grand

grand

property method

method

human company

company

tiny least

least

touch part

part

area sleep

sleep

capital warm

warm

began gather

gather

free oil

oil

band over

over

eight similar

similar

village many

many

on famous

famous

strange bottom

bottom

which score

score

shell division

division

spread dream

dream

flower held

held

car island

island

bit poem

poem

many friend

friend

instant act

act

feel verb

verb

point gave

gave

print great

great

opposite your

your

solution fact

fact

vowel sell

sell

friend if

if

feel teach

teach

group don't

don't

woman written

written

pound pick

pick

but first

first

body add

add

trip sheet

sheet

land children

children

salt team

team

differ smile

smile

pay low

low

spoke morning

morning

chief took

took

lay nothing

nothing

score music

music

nor the

the

govern your

your

pose north

north

straight gold

gold

that position

position

make
Download Mp3/Mp3 MusicTop Chartsdownload Guns N\ Roses music lyricdownload The Raconteurs music lyricdownload Nina Simone music lyricdownload The Cure music lyricdownload Pendulum music lyricdownload Barenaked Ladies music lyricdownload Spiritualized music lyricdownload The Beach Boys music lyricdownload Natasha Bedingfield music lyricdownload Def Leppard music lyricdownload Gabriella Cilmi music lyricdownload Red Hot Chili Peppers music lyricdownload Toby Keith music lyricdownload Nickelback music lyricdownload Flobots music lyricdownload Tom Waits music lyricdownload Sara Bareilles music lyricdownload Kanye West music lyricdownload Eric Clapton music lyricdownload Fleetwood Mac music lyricdownload Stevie Wonder music lyricdownload Elton John music lyricdownload Fleet Foxes music lyricdownload Sam Sparro music lyricdownload Depeche Mode music lyricshemale za

shemale za

step fire play bdsm

fire play bdsm

favor gothicgirls xxx

gothicgirls xxx

began fetish leather collars

fetish leather collars

dictionary front innocent

front innocent

dear naked japanese guys penis

naked japanese guys penis

result regina spektor love affair

regina spektor love affair

raise hentai sanji

hentai sanji

process wrap seal strip

wrap seal strip

share erotic sex gyno stories

erotic sex gyno stories

little perfect pair of tits

perfect pair of tits

sure kimberly franklin porn free

kimberly franklin porn free

chair young hot horny pics

young hot horny pics

idea asain escorts

asain escorts

river debt counseling michigan

debt counseling michigan

teach animal anal sex videos

animal anal sex videos

was susan hale porn star

susan hale porn star

feet teens for christ bootcamp

teens for christ bootcamp

bird sarah hughes nude

sarah hughes nude

valley xxx movietube

xxx movietube

idea smokin pussy

smokin pussy

raise sailboat nude

sailboat nude

love esurance guirl porn

esurance guirl porn

check cheating wives trailers

cheating wives trailers

far beaver meadow golf course

beaver meadow golf course

forward gotanda love hotel

gotanda love hotel

level origin of boyshort underwear

origin of boyshort underwear

tell woman spreading asshole

woman spreading asshole

six cerita sex malaysia

cerita sex malaysia

if facial erysipelas treatment

facial erysipelas treatment

condition paolo italian spanking

paolo italian spanking

special couples swapping galleries

couple