Class Index | File Index

Classes


Class M.ToggleView


Extends M.View.
M.ToggleView defines the prototype of any toggle view. A toggle view accepts exactly two child views and provides an easy mechanism to toggle between these two views. An easy example would be to define two different button views that can be toggled, a more complex scenario would be to define two content views (M.ScrollView) with own child views and toggle between them.
Defined in: toggle.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
 
Contains a reference to the currently displayed view.
 
States whether the toggle view currently displays its first child view or its second child view.
 
Determines whether to toggle the view on click.
 
The type of this object.
Fields borrowed from class M.View:
childViews, computedValue, contentBinding, contentBindingReverse, cssClass, cssClassOnError, cssClassOnInit, cssStyle, events, hasFocus, html, id, isInline, isView, modelId, parentView, recommendedEvents, triggerActionOnChange, triggerActionOnEnter, triggerActionOnKeyUp, value
Method Summary
Method Attributes Method Name and Description
 
This method renders one child view of the toggle view, based on the isInFirstState property: YES = first child view, NO = second child view.
 
setView(view)
This method can be used to set on of the toggle view's child views as the active one.
 
toggleView(id, event, nextEvent)
This method toggles the child views by first emptying the toggle view's content and then rendering the next child view by calling renderUpdateChildViews().
Methods borrowed from class M.View:
addCssClass, attachToObservable, clearHtml, clearValue, clearValues, computeValue, contentDidChange, delegateValueUpdate, design, getChildViewsAsArray, getIds, getValue, getValues, gotFocus, lostFocus, nl2br, registerEvents, removeCssClass, removeCssProperty, renderUpdate, secure, setCssProperty, setValueFromDOM, style, tab2space, theme, themeChildViews
Methods borrowed from class M.Object:
bindToCaller, create, destroy, extend, get, include, set
Class Detail
M.ToggleView()
Field Detail
{M.View} currentView
Contains a reference to the currently displayed view.

{Boolean} isInFirstState
States whether the toggle view currently displays its first child view or its second child view.

{Boolean} toggleOnClick
Determines whether to toggle the view on click. This might be useful if the child views are e.g. buttons.

{String} type
The type of this object.
Method Detail
renderChildViews()
This method renders one child view of the toggle view, based on the isInFirstState property: YES = first child view, NO = second child view.

setView(view)
This method can be used to set on of the toggle view's child views as the active one. Simply pass the view, its id or its name. If a view or id is passed, that does not match on of the toggle view's child views, nothing will be done.
Parameters:
{Object|String} view
The corresponding view.

toggleView(id, event, nextEvent)
This method toggles the child views by first emptying the toggle view's content and then rendering the next child view by calling renderUpdateChildViews().
Parameters:
id
event
nextEvent

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Jan 25 2012 20:41:11 GMT+0100 (MEZ)