Index

Classes

Class

Methods

Class Banana.UiControl


Extends Banana.Control.

Methods borrowed from class Banana.Control:
applyToChildren, bind, clear, createComponents, findControl, generateUniqueId, getControls, getDomEventTypes, getFirstUiControl, getId, getPage, getParent, getProxy, hasBind, invalidateDisplay, onPreInvalidateContents, onWindowResize, remove, render, setId, setPage, setParent, unbind, unload, updateDisplay

Defined in: UiControl.js.

Class Detail
Banana.UiControl()
Method Detail
addControl(true)

Adds control to collection Normally you would add control prior to the render phase. If this is not the case and you need to instantly render the control. autoRender should be true

Parameters:
{mixed} Banana.Control
or plain text
{boolean} true
when render should occur instantly
addCss(css)

adds css style in object key value style.

Parameters:
{Object} css
example {width:'100px',left:0};
addCssClass(css)

Adds css class. this will be instantly applied to dom if rendered

Parameters:
{String} css
name of css class
{String} getAttribute(key)
Parameters:
{String} key
of the attribute
Returns:
{String} attribute by key
{Object} getAttributes()

Composes attributes for usuage in html tags.

Returns:
{Object} of attributes
{String} getClientId()
Returns:
{String} reference to the dom node id
{Object} getCss()
Returns:
{Object} of css properties in key value format
{Array} getCssClass()
Returns:
{Array} of currently added css classes
{Object} getDimensions()

Computes widht,height and left right offsets

Returns:
{Object} of dimensions
{String} getHtml(markAsRendered)

returns html markup string of control + all child controls

Parameters:
markAsRendered
Returns:
{String}
{String} getHtmlAttributes()

return string representation of html attributes. used by renderer

Returns:
{String}
{String} getState(name)

Retreives a saved state

Parameters:
{String} name
of state
Returns:
{String}
{String} getStyle()
Returns:
{String}
{String} getStyleProperty(prop)
Parameters:
prop
Returns:
{String} value of css property
getTagName()
Returns:
string tag name of control overwrite this function to use your own tags. ie
{boolean} hasCssClass(search)
Parameters:
search
Returns:
{boolean}
registerEvents()

register all binded events

removeAttribute(key)
Parameters:
key
removeCssClass(css)

removes css class. this will be instantly applied to dom

Parameters:
{String} css
name of css class
{String} removeState(name)

Removes a saved state

Parameters:
{String} name
of state
Returns:
{String}
{this} setAttribute(key, value)

sets attribute depending on the type of key we set prop or attr

see http://blog.jquery.com/ for more information

Parameters:
{String} key
{String} value
Returns:
{this}
setClientId(cid)

sets client id used to reference dom node. This method is auto called by the page

Parameters:
{String} cid
setCss(css)

adds css style and instantly apply it to dom if rendered

Parameters:
{Object} css
setEnabled(e, recursive)

sets control enabled /disabled we basicly add a css class. so, make sure your css file contains this css classes TODO this is not nice, can it be done otherwise?

Parameters:
{boolean} e
True when enabled
{boolean} recursive
Also enable/disable child controls
{this} setState(name, value)

Saves key value in a cookie Note that saved states are always unique for a page.

Parameters:
{String} name
of the state
{String} value
Returns:
{this}
{this} setStyle(style)

NOTE: use setCss() instead to directly apply it to dom

Parameters:
{String} style
of this control. by css definitions
Returns:
{this}
setVisible(v, speed, type, callback)

makes control visible or invisible.

Parameters:
{boolean} v
true when visible
{String} speed
animation speed of hiding/ showing
{String} type
of animation
{Function} callback
when finished
switchCssClass(oldClass, newClass)

Switch the old Css class with a new one

Parameters:
{String} oldClass
Old CSS class to replace
{String} newClass
New CSS class to add
triggerEvent(name, data)

Triggers an event which will notify all listeners Optionally data can be send along.

Parameters:
{String} name
of the event to be triggered
{mixed} data
unregisterEvents()

unregister all binded events. note we dont touch the bind array, cause we might rebind it at a later moment. ie rerender used by framework


Documentation generated by JsDoc Toolkit 2.4.0 on Wed Dec 05 2012 22:02:04 GMT+0100 (CET)