dojox/mobile/SwapView (version 1.10)

dojox/mobile/View, dojox/mobile/_ScrollableMixin

Summary

A container that can be swiped horizontally.

SwapView is a container widget which can be swiped horizontally. SwapView is a subclass of dojox/mobile/View. It allows the user to swipe the screen left or right to move between the views. When SwapView is swiped, it finds an adjacent SwapView to open. When the transition is done, a topic "/dojox/mobile/viewChanged" is published. Note that, to behave properly, the SwapView needs to occupy the entire width of the screen.

Usage

var foo = new SwapView(params,node);
dojox/mobile/View
Parameter Type Description
params Object

Contains the parameters.

node DomNode
Optional

The DOM node. If none is specified, it is automatically created.

See the dojox/mobile/SwapView reference documentation for more information.

Property Summary

  • _attrPairNames
  • _blankGifPath to a blank 1x1 image.
  • _endOfTransitionTimeoutHandleThe handle (returned by _WidgetBase.defer) for the timeout set on touchEnd in case the end of transition event is not fired by the browser.
  • _fixedAppFooter
  • _movedFlag that signals if the user have moved in (one of) the scroll direction(s) since touch start (a move under the threshold is ignored).
  • _parentPadBorderExtentsBottomFor Tooltip.js.
  • _setClassAttr
  • _setDirAttr
  • _setIdAttr
  • _setLangAttr
  • _setTypeAttr
  • _startedstartup() has completed.
  • allowNestedScrollsFlag to allow scrolling in nested containers, e.g. to allow ScrollableView in a SwapView.
  • appBarsEnables the search for application-specific bars (header or footer).
  • attributeMapDeprecated.
  • baseClass
  • class
  • constraintbounce back to the content area
  • containerNodeDesignates where children of the source DOM node will be placed. "Children" in this case refers to both DOM nodes and widgets.
  • dirBi-directional support, as defined by the HTML DIR attribute.
  • dirLockdisable the move handler if scroll starts in the unexpected direction
  • disableFlashScrollBar
  • domNodeThis is our visible representation of the widget!
  • fadeScrollBar
  • fixedFooterId of the fixed footer.
  • fixedFooterHeightheight of a fixed footer
  • fixedHeaderId of the fixed header.
  • fixedHeaderHeightheight of a fixed header
  • focusedThis widget or a widget it contains has focus, or is "active" because it was recently clicked.
  • heightexplicitly specified height of this widget (ex. "300px")
  • idA unique, opaque ID string that can be assigned by users or by the system.
  • isLocalFooterfooter is view-local (as opposed to application-wide)
  • keepScrollPosIf true, the scroll position is kept when transition occurs between views.
  • langRarely used.
  • ownerDocumentThe document this widget belongs to.
  • propagatablelet touchstart event propagate up
  • scrollableParamsParameters for dojox/mobile/scrollable.init().
  • scrollBarshow scroll bar or not
  • scrollDirScroll direction, used by dojox/mobile/scrollable (always "f" for this class).
  • scrollType1: use (-webkit-)transform:translate3d(x,y,z) style, use (-webkit-)animation for slide animation 2: use top/left style, 3: use (-webkit-)transform:translate3d(x,y,z) style, use (-webkit-)transition for slide animation 0: use default value (3 for Android, iOS6+, and BlackBerry; otherwise 1)
  • selectedIf true, the view is displayed at startup time.
  • srcNodeRefpointer to original DOM node
  • styleHTML style attributes as cssText string or name/value hash
  • tagThe name of the HTML tag to create as domNode.
  • thresholddrag threshold value in pixels
  • titleHTML title attribute.
  • tooltipWhen this widget's title attribute is used to for a tab label, accordion pane title, etc., this specifies the tooltip to appear when the mouse is hovered over that text.
  • touchNodea node that will have touch event handlers
  • weightFrictional weight used to compute scrolling speed.

Method Summary

  • _addTransitionPaddingTop(value)
  • _applyAttributes() Step during widget creation to copy widget attributes to the DOM according to attributeMap and _setXXXAttr objects, and also to call custom _setXXXAttr() methods.
  • _attrToDom(attr,value,commands) Reflect a widget attribute (title, tabIndex, duration etc.) to the widget DOM, as specified by commands parameter.
  • _changeAttrValue(name,value) Internal helper for directly changing an attribute value.
  • _clearClasses(node) Clean up the domNode classes that were added while making a transition.
  • _doTransition(fromNode,toNode,transition,transitionDir)
  • _fixViewState(toNode) Sanity check for view transition states.
  • _get(name) Helper function to get value for specified property stored by this._set(), i.e. for properties with custom setters.
  • _getAttrNames(name) Helper function for get() and set().
  • _getSibling(which) Returns next or previous sibling
  • _getSiblingOfChild(child,dir) Get the next or previous widget sibling of child
  • _introspect() Collect metadata about this widget (only once per class, not once per instance): - list of attributes with custom setters, storing in this.constructor._setterAttrs - generate this.constructor._onMap, mapping names like "mousedown" to functions like onMouseDown
  • _isBookmarkable(detail)
  • _keepInputCaretInActiveElement()
  • _removeTransitionPaddingTop()
  • _runSlideAnimation(from,to,duration,easing,node,idx)
  • _set(name,value) Helper function to set new value for specified property, and call handlers registered with watch() if the value has changed.
  • _setOwnerDocumentAttr(val)
  • _setSiblingViewsInMotion(inMotion)
  • _setStyleAttr(value) Sets the style attribute of the widget according to value, which is either a hash like {height: "5px", width: "3px"} or a plain string
  • _siblingViewsInMotion()
  • _toCls(s)
  • abort() Aborts scrolling.
  • addChild(widget,insertIndex) Makes the given widget a child of this widget.
  • addCover() Adds the transparent DIV cover.
  • adjustDestination(to,pos,dim) A stub function to be overridden by subclasses.
  • buildRendering()
  • calcScrollBarPos(to) Calculates the scroll bar position.
  • calcSpeed(distance,time) Calculate the speed given the distance and time.
  • checkFixedBar(node,local) Checks if the given node is a fixed bar or not.
  • cleanup() Uninitialize the module.
  • connect(obj,event,method) Deprecated, will be removed in 2.0, use this.own(on(...)) or this.own(aspect.after(...)) instead.
  • convertToId(moveTo)
  • create(params,srcNodeRef) Kick off the life-cycle of a widget
  • createMask() Creates a mask for a scroll bar edge.
  • defer(fcn,delay) Wrapper to setTimeout to avoid deferred functions executing after the originating widget has been destroyed.
  • destroy()
  • destroyDescendants(preserveDom) Recursively destroy the children of this widget and their descendants.
  • destroyRecursive(preserveDom) Destroy this widget and its descendants
  • destroyRendering(preserveDom) Destroys the DOM nodes associated with this widget.
  • disconnect(handle) Deprecated, will be removed in 2.0, use handle.remove() instead.
  • emit(type,eventObj,callbackArgs) Used by widgets to signal that a synthetic event occurred, ex: myWidget.emit("attrmodified-selectedChildWidget", {}).
  • findAppBars() Search for application-specific header or footer.
  • findDisp(node) Overrides dojox/mobile/scrollable.findDisp().
  • flashScrollBar() Shows the scroll bar instantly.
  • get(name) Get a property from a widget.
  • getChildren() Returns all direct children of this widget, i.e. all widgets underneath this.containerNode whose parent is this widget.
  • getDim() Returns various internal dimensional information needed for calculation.
  • getIndexInParent() Returns the index of this widget within its container parent.
  • getIndexOfChild(child) Gets the index of the child in this container or -1 if not found
  • getNextSibling() Returns null if this is the last child of the parent, otherwise returns the next element sibling to the "right".
  • getParent() Returns the parent widget of this widget.
  • getPos() Gets the top position in the midst of animation.
  • getPreviousSibling() Returns null if this is the first child of the parent, otherwise returns the next element sibling to the "left".
  • getScreenSize() Returns the dimensions of the browser window.
  • getShowingView() Find the currently showing view from my sibling views.
  • getSiblingViews() Returns an array of the sibling views.
  • getSpeed() Returns an object that indicates the scrolling speed.
  • goTo(dir,moveTo) Moves to the next or previous view.
  • handleNextPage(w) Called when the "/dojox/mobile/nextPage" topic is published.
  • handlePrevPage(w) Called when the "/dojox/mobile/prevPage" topic is published.
  • hasChildren() Returns true if widget has child widgets, i.e. if this.containerNode contains widgets.
  • hide() Hides this view without a transition animation.
  • hideScrollBar() Hides the scroll bar.
  • init(params) Initialize according to the given params.
  • invokeCallback() A function to be called after performing a transition to call a specified callback.
  • isFocusable() Return true if this widget can currently be focused and false if not
  • isFormElement(node) Returns true if the given node is a form control.
  • isLeftToRight() Return this widget's explicit or implicit orientation (true for LTR, false for RTL)
  • isSwapView(node) Returns true if the given node is a SwapView widget.
  • isTopLevel() Returns true if this is a top-level widget.
  • isVisible(checkAncestors) Return true if this view is visible
  • makeTranslateStr(to) Constructs a string value that is passed to the -webkit-transform property.
  • nextView(node) Returns the next view.
  • on(type,func) Call specified function when event occurs, ex: myWidget.on("click", function(){ ... }).
  • own() Track specified handles and remove/destroy them when this instance is destroyed, unless they were already removed/destroyed manually.
  • performTransition(moveTo,transitionDir,transition,context,method) Function to perform the various types of view transitions, such as fade, slide, and flip.
  • placeAt(reference,position) Place this widget somewhere in the DOM based on standard domConstruct.place() conventions.
  • postCreate() Processing after the DOM fragment is created
  • postMixInProperties() Called after the parameters to the widget have been read-in, but before the widget template is instantiated.
  • postscript(params,srcNodeRef) Kicks off widget instantiation.
  • previousView(node) Returns the previous view.
  • removeChild(widget) Removes the passed widget instance from this widget but does not destroy it.
  • removeCover() Removes the transparent DIV cover.
  • resetScrollBar() Resets the scroll bar length, position, etc.
  • resize() Calls resize() of each child widget.
  • scrollIntoView(node,alignWithTop,duration) Scrolls the pane until the searching node is in the view.
  • scrollScrollBarTo(to) Moves the scroll bar(s) to the given position without animation.
  • scrollTo(to) Overrides dojox/mobile/scrollable.scrollTo().
  • set(name,value) Set a property on a widget
  • setKeyframes(from,to,idx) Programmatically sets key frames for the scroll animation.
  • setSelectable(node,selectable) Sets the given node as selectable or unselectable.
  • show(noEvent,doNotHideOthers) Shows this view without a transition animation.
  • showScrollBar() Shows the scroll bar.
  • slideScrollBarTo(to,duration,easing) Moves the scroll bar(s) to the given position with the slide animation.
  • slideTo(to,duration,easing,fake_pos) Overrides dojox/mobile/scrollable.slideTo().
  • startup()
  • stopAnimation() Stops the currently running animation.
  • subscribe(t,method) Deprecated, will be removed in 2.0, use this.own(topic.subscribe()) instead.
  • toString() Returns a string that represents the widget.
  • uninitialize() Deprecated.
  • unsubscribe(handle) Deprecated, will be removed in 2.0, use handle.remove() instead.
  • watch(name,callback) Watches a property for changes

Event Summary

  • _onBlur() This is where widgets do processing for when they stop being active, such as changing CSS classes.
  • _onFocus() This is where widgets do processing for when they are active, such as changing CSS classes.
  • _onMap(type) Maps on() type parameter (ex: "mousemove") to method name (ex: "onMouseMove").
  • onAfterScroll(e) called after a scroll has been performed.
  • onAfterTransitionIn(moveTo,dir,transition,context,method) Stub function to connect to from your application.
  • onAfterTransitionOut(moveTo,dir,transition,context,method) Stub function to connect to from your application.
  • onAnimationEnd(e) Overrides dojox/mobile/View.onAnimationEnd().
  • onAnimationStart(e) A handler that is called when transition animation starts.
  • onBeforeScroll(e) called before a scroll is initiated.
  • onBeforeTransitionIn(moveTo,dir,transition,context,method) Stub function to connect to from your application.
  • onBeforeTransitionOut(moveTo,dir,transition,context,method) Stub function to connect to from your application.
  • onBlur() Called when the widget stops being "active" because focus moved to something outside of it, or the user clicked somewhere outside of it, or the widget was hidden.
  • onFlickAnimationEnd(e)
  • onFlickAnimationStart(e)
  • onFocus() Called when the widget becomes "active" because it or a widget inside of it either has focus, or has recently been clicked.
  • onStartView() Stub function to connect to from your application.
  • onTouchEnd(e)
  • onTouchMove(e) User-defined function to handle touchMove events.
  • onTouchStart(e) Internal function to handle touchStart events.

Properties

_attrPairNames
Defined by: dijit/_WidgetBase
_blankGif
Defined by: dijit/_WidgetBase

Path to a blank 1x1 image. Used by <img> nodes in templates that really get their image via CSS background-image.

_endOfTransitionTimeoutHandle
Defined by: dojox/mobile/SwapView

The handle (returned by _WidgetBase.defer) for the timeout set on touchEnd in case the end of transition event is not fired by the browser.

_fixedAppFooter
_moved

Flag that signals if the user have moved in (one of) the scroll direction(s) since touch start (a move under the threshold is ignored).

_parentPadBorderExtentsBottom

For Tooltip.js.

_setClassAttr
Defined by: dijit/_WidgetBase
_setDirAttr
Defined by: dijit/_WidgetBase
_setIdAttr
Defined by: dijit/_WidgetBase
_setLangAttr
Defined by: dijit/_WidgetBase
_setTypeAttr
Defined by: dijit/_WidgetBase
_started
Defined by: dijit/_WidgetBase

startup() has completed.

allowNestedScrolls

Flag to allow scrolling in nested containers, e.g. to allow ScrollableView in a SwapView.

appBars

Enables the search for application-specific bars (header or footer).

attributeMap
Defined by: dijit/_WidgetBase

Deprecated. Instead of attributeMap, widget should have a _setXXXAttr attribute for each XXX attribute to be mapped to the DOM.

attributeMap sets up a "binding" between attributes (aka properties) of the widget and the widget's DOM. Changes to widget attributes listed in attributeMap will be reflected into the DOM.

For example, calling set('title', 'hello') on a TitlePane will automatically cause the TitlePane's DOM to update with the new title.

attributeMap is a hash where the key is an attribute of the widget, and the value reflects a binding to a:

  • DOM node attribute

    focus: {node: "focusNode", type: "attribute"} Maps this.focus to this.focusNode.focus

  • DOM node innerHTML

    title: { node: "titleNode", type: "innerHTML" } Maps this.title to this.titleNode.innerHTML

  • DOM node innerText

    title: { node: "titleNode", type: "innerText" } Maps this.title to this.titleNode.innerText

  • DOM node CSS class

    myClass: { node: "domNode", type: "class" } Maps this.myClass to this.domNode.className

If the value is an array, then each element in the array matches one of the formats of the above list.

There are also some shorthands for backwards compatibility:

  • string --> { node: string, type: "attribute" }, for example:
"focusNode" ---> { node: "focusNode", type: "attribute" }
  • "" --> { node: "domNode", type: "attribute" }
baseClass
Defined by: dojox/mobile/View
class
Defined by: dijit/_WidgetBase
constraint

bounce back to the content area

containerNode
Defined by: dijit/_WidgetBase

Designates where children of the source DOM node will be placed. "Children" in this case refers to both DOM nodes and widgets. For example, for myWidget:

<div data-dojo-type=myWidget>
    <b> here's a plain DOM node
    <span data-dojo-type=subWidget>and a widget</span>
    <i> and another plain DOM node </i>
</div>

containerNode would point to:

<b> here's a plain DOM node
<span data-dojo-type=subWidget>and a widget</span>
<i> and another plain DOM node </i>

In templated widgets, "containerNode" is set via a data-dojo-attach-point assignment.

containerNode must be defined for any widget that accepts innerHTML (like ContentPane or BorderContainer or even Button), and conversely is null for widgets that don't, like TextBox.

dir
Defined by: dijit/_WidgetBase

Bi-directional support, as defined by the HTML DIR attribute. Either left-to-right "ltr" or right-to-left "rtl". If undefined, widgets renders in page's default direction.

dirLock

disable the move handler if scroll starts in the unexpected direction

disableFlashScrollBar
domNode
Defined by: dijit/_WidgetBase

This is our visible representation of the widget! Other DOM Nodes may by assigned to other properties, usually through the template system's data-dojo-attach-point syntax, but the domNode property is the canonical "top level" node in widget UI.

fadeScrollBar
fixedFooter

Id of the fixed footer.

fixedFooterHeight

height of a fixed footer

fixedHeader

Id of the fixed header.

fixedHeaderHeight

height of a fixed header

focused
Defined by: dijit/_FocusMixin

This widget or a widget it contains has focus, or is "active" because it was recently clicked.

height

explicitly specified height of this widget (ex. "300px")

id
Defined by: dijit/_WidgetBase

A unique, opaque ID string that can be assigned by users or by the system. If the developer passes an ID which is known not to be unique, the specified ID is ignored and the system-generated ID is used instead.

isLocalFooter

footer is view-local (as opposed to application-wide)

keepScrollPos
Defined by: dojox/mobile/View

If true, the scroll position is kept when transition occurs between views.

lang
Defined by: dijit/_WidgetBase

Rarely used. Overrides the default Dojo locale used to render this widget, as defined by the HTML LANG attribute. Value must be among the list of locales specified during by the Dojo bootstrap, formatted according to RFC 3066 (like en-us).

ownerDocument
Defined by: dijit/_WidgetBase

The document this widget belongs to. If not specified to constructor, will default to srcNodeRef.ownerDocument, or if no sourceRef specified, then to the document global

propagatable

let touchstart event propagate up

scrollableParams
scrollBar

show scroll bar or not

scrollDir
Defined by: dojox/mobile/SwapView

Scroll direction, used by dojox/mobile/scrollable (always "f" for this class).

scrollType
  • 1: use (-webkit-)transform:translate3d(x,y,z) style, use (-webkit-)animation for slide animation
  • 2: use top/left style,
  • 3: use (-webkit-)transform:translate3d(x,y,z) style, use (-webkit-)transition for slide animation
  • 0: use default value (3 for Android, iOS6+, and BlackBerry; otherwise 1)
selected
Defined by: dojox/mobile/View

If true, the view is displayed at startup time.

srcNodeRef
Defined by: dijit/_WidgetBase

pointer to original DOM node

style
Defined by: dijit/_WidgetBase

HTML style attributes as cssText string or name/value hash

tag
Defined by: dojox/mobile/View

The name of the HTML tag to create as domNode. The default value is "div".

threshold

drag threshold value in pixels

title
Defined by: dijit/_WidgetBase

HTML title attribute.

For form widgets this specifies a tooltip to display when hovering over the widget (just like the native HTML title attribute).

For TitlePane or for when this widget is a child of a TabContainer, AccordionContainer, etc., it's used to specify the tab label, accordion pane title, etc. In this case it's interpreted as HTML.

tooltip
Defined by: dijit/_WidgetBase

When this widget's title attribute is used to for a tab label, accordion pane title, etc., this specifies the tooltip to appear when the mouse is hovered over that text.

touchNode

a node that will have touch event handlers

weight
Defined by: dojox/mobile/SwapView

Frictional weight used to compute scrolling speed.

Methods

_addTransitionPaddingTop(value)
Defined by dojox/mobile/View
Parameter Type Description
value String | Integer
_applyAttributes()
Defined by dijit/_WidgetBase

Step during widget creation to copy widget attributes to the DOM according to attributeMap and _setXXXAttr objects, and also to call custom _setXXXAttr() methods.

Skips over blank/false attribute values, unless they were explicitly specified as parameters to the widget, since those are the default anyway, and setting tabIndex="" is different than not setting tabIndex at all.

For backwards-compatibility reasons attributeMap overrides _setXXXAttr when _setXXXAttr is a hash/string/array, but _setXXXAttr as a functions override attributeMap.

_attrToDom(attr,value,commands)
Defined by dijit/_WidgetBase

Reflect a widget attribute (title, tabIndex, duration etc.) to the widget DOM, as specified by commands parameter. If commands isn't specified then it's looked up from attributeMap. Note some attributes like "type" cannot be processed this way as they are not mutable.

Parameter Type Description
attr String

Name of member variable (ex: "focusNode" maps to this.focusNode) pointing to DOMNode inside the widget, or alternately pointing to a subwidget

value String
commands Object
Optional
_changeAttrValue(name,value)
Defined by dojo/Stateful

Internal helper for directly changing an attribute value.

Directly change the value of an attribute on an object, bypassing any accessor setter. Also handles the calling of watch and emitting events. It is designed to be used by descendant class when there are two values of attributes that are linked, but calling .set() is not appropriate.

Parameter Type Description
name String

The property to set.

value Mixed

The value to set in the property.

Returns:function

Internal helper for directly changing an attribute value.

_clearClasses(node)
Defined by dojox/mobile/View

Clean up the domNode classes that were added while making a transition.

Remove all the "mbl" prefixed classes except mbl*View.

Parameter Type Description
node DomNode
_doTransition(fromNode,toNode,transition,transitionDir)
Defined by dojox/mobile/View
Parameter Type Description
fromNode undefined
toNode undefined
transition undefined
transitionDir undefined
_fixViewState(toNode)
Defined by dojox/mobile/View

Sanity check for view transition states.

Sometimes uninitialization of Views fails after making view transition, and that results in failure of subsequent view transitions. This function does the uninitialization for all the sibling views.

Parameter Type Description
toNode DomNode
_get(name)
Defined by dijit/_WidgetBase

Helper function to get value for specified property stored by this._set(), i.e. for properties with custom setters. Used mainly by custom getters.

For example, CheckBox._getValueAttr() calls this._get("value").

Parameter Type Description
name String
Returns:undefined
_getAttrNames(name)
Defined by dijit/_WidgetBase

Helper function for get() and set(). Caches attribute name values so we don't do the string ops every time.

Parameter Type Description
name undefined
Returns:undefined | object
_getSibling(which)
Defined by dijit/_Contained

Returns next or previous sibling

Parameter Type Description
which String

Either "next" or "previous"

Returns:undefined
_getSiblingOfChild(child,dir)
Defined by dijit/_Container

Get the next or previous widget sibling of child

Parameter Type Description
child dijit/_WidgetBase
dir int

if 1, get the next sibling if -1, get the previous sibling

Returns:undefined
_introspect()
Defined by dijit/_WidgetBase

Collect metadata about this widget (only once per class, not once per instance):

- list of attributes with custom setters, storing in this.constructor._setterAttrs
- generate this.constructor._onMap, mapping names like "mousedown" to functions like onMouseDown
_isBookmarkable(detail)
Defined by dojox/mobile/View
Parameter Type Description
detail undefined
Returns:undefined
_keepInputCaretInActiveElement()
_removeTransitionPaddingTop()
Defined by dojox/mobile/View
_runSlideAnimation(from,to,duration,easing,node,idx)
Parameter Type Description
from Object
to Object
duration Number
easing String
node DomNode
idx Number
_set(name,value)
Defined by dijit/_WidgetBase

Helper function to set new value for specified property, and call handlers registered with watch() if the value has changed.

Parameter Type Description
name String
value anything
_setOwnerDocumentAttr(val)
Defined by dijit/_WidgetBase
Parameter Type Description
val undefined
_setSiblingViewsInMotion(inMotion)
Parameter Type Description
inMotion Boolean
_setStyleAttr(value)
Defined by dijit/_WidgetBase

Sets the style attribute of the widget according to value, which is either a hash like {height: "5px", width: "3px"} or a plain string

Determines which node to set the style on based on style setting in attributeMap.

Parameter Type Description
value String | Object
_siblingViewsInMotion()
Returns:boolean
_toCls(s)
Defined by dojox/mobile/View
Parameter Type Description
s undefined
Returns:string
abort()

Aborts scrolling.

This function stops the scrolling animation that is currently running. It is called when the user touches the screen while scrolling.

addChild(widget,insertIndex)
Defined by dijit/_Container

Makes the given widget a child of this widget.

Inserts specified child widget's dom node as a child of this widget's container node, and possibly does other processing (such as layout).

Parameter Type Description
widget dijit/_WidgetBase
insertIndex int
Optional
addCover()

Adds the transparent DIV cover.

The cover is to prevent DOM events from affecting the child widgets such as a list widget. Without the cover, for example, child widgets may receive a click event and respond to it unexpectedly when the user flicks the screen to scroll. Note that only the desktop browsers need the cover.

adjustDestination(to,pos,dim)

A stub function to be overridden by subclasses.

This function is called from onTouchEnd(). The purpose is to give its subclasses a chance to adjust the destination position. If this function returns false, onTouchEnd() returns immediately without performing scroll.

Parameter Type Description
to Object

The destination position. An object with x and y.

pos Object

The current position. An object with x and y.

dim Object

Dimension information returned by getDim().

Returns:boolean
buildRendering()
calcScrollBarPos(to)

Calculates the scroll bar position.

Given the scroll destination position, calculates the top and/or the left of the scroll bar(s). Returns an object with x and y.

Parameter Type Description
to Object

The scroll destination position. An object with x and y. ex. {x:0, y:-5}

Returns:object
calcSpeed(distance,time)

Calculate the speed given the distance and time.

Parameter Type Description
distance Number
time Number
Returns:number
checkFixedBar(node,local)

Checks if the given node is a fixed bar or not.

Parameter Type Description
node DomNode
local Boolean
Returns:undefined | null
cleanup()

Uninitialize the module.

connect(obj,event,method)
Defined by dijit/_WidgetBase

Deprecated, will be removed in 2.0, use this.own(on(...)) or this.own(aspect.after(...)) instead.

Connects specified obj/event to specified method of this object and registers for disconnect() on widget destroy.

Provide widget-specific analog to dojo.connect, except with the implicit use of this widget as the target object. Events connected with this.connect are disconnected upon destruction.

Parameter Type Description
obj Object | null
event String | Function
method String | Function
Returns:any | undefined

A handle that can be passed to disconnect in order to disconnect before the widget is destroyed.

Examples

Example 1

var btn = new Button();
// when foo.bar() is called, call the listener we're going to
// provide in the scope of btn
btn.connect(foo, "bar", function(){
    console.debug(this.toString());
});
convertToId(moveTo)
Defined by dojox/mobile/View
Parameter Type Description
moveTo undefined
Returns:undefined
create(params,srcNodeRef)
Defined by dijit/_WidgetBase

Kick off the life-cycle of a widget

Create calls a number of widget methods (postMixInProperties, buildRendering, postCreate, etc.), some of which of you'll want to override. See http://dojotoolkit.org/reference-guide/dijit/_WidgetBase.html for a discussion of the widget creation lifecycle.

Of course, adventurous developers could override create entirely, but this should only be done as a last resort.

Parameter Type Description
params Object | null

Hash of initialization parameters for widget, including scalar values (like title, duration etc.) and functions, typically callbacks like onClick. The hash can contain any of the widget's properties, excluding read-only properties.

srcNodeRef DOMNode | String
Optional

If a srcNodeRef (DOM node) is specified:

  • use srcNodeRef.innerHTML as my contents
  • if this is a behavioral widget then apply behavior to that srcNodeRef
  • otherwise, replace srcNodeRef with my generated DOM tree
createMask()

Creates a mask for a scroll bar edge.

This function creates a mask that hides corners of one scroll bar edge to make it round edge. The other side of the edge is always visible and round shaped with the border-radius style.

defer(fcn,delay)
Defined by dijit/_WidgetBase

Wrapper to setTimeout to avoid deferred functions executing after the originating widget has been destroyed. Returns an object handle with a remove method (that returns null) (replaces clearTimeout).

Parameter Type Description
fcn Function

Function reference.

delay Number
Optional

Delay, defaults to 0.

Returns:object
destroy()
Defined by dojox/mobile/View
destroyDescendants(preserveDom)
Defined by dijit/_WidgetBase

Recursively destroy the children of this widget and their descendants.

Parameter Type Description
preserveDom Boolean
Optional

If true, the preserveDom attribute is passed to all descendant widget's .destroy() method. Not for use with _Templated widgets.

destroyRecursive(preserveDom)
Defined by dijit/_WidgetBase

Destroy this widget and its descendants

This is the generic "destructor" function that all widget users should call to cleanly discard with a widget. Once a widget is destroyed, it is removed from the manager object.

Parameter Type Description
preserveDom Boolean
Optional

If true, this method will leave the original DOM structure alone of descendant Widgets. Note: This will NOT work with dijit._TemplatedMixin widgets.

destroyRendering(preserveDom)
Defined by dijit/_WidgetBase

Destroys the DOM nodes associated with this widget.

Parameter Type Description
preserveDom Boolean
Optional

If true, this method will leave the original DOM structure alone during tear-down. Note: this will not work with _Templated widgets yet.

disconnect(handle)
Defined by dijit/_WidgetBase

Deprecated, will be removed in 2.0, use handle.remove() instead.

Disconnects handle created by connect.

Parameter Type Description
handle undefined
emit(type,eventObj,callbackArgs)
Defined by dijit/_WidgetBase

Used by widgets to signal that a synthetic event occurred, ex:

myWidget.emit("attrmodified-selectedChildWidget", {}).

Emits an event on this.domNode named type.toLowerCase(), based on eventObj. Also calls onType() method, if present, and returns value from that method. By default passes eventObj to callback, but will pass callbackArgs instead, if specified. Modifies eventObj by adding missing parameters (bubbles, cancelable, widget).

Parameter Type Description
type String
eventObj Object
Optional
callbackArgs Array
Optional
Returns:undefined
findAppBars()

Search for application-specific header or footer.

findDisp(node)

Overrides dojox/mobile/scrollable.findDisp().

When this function is called from scrollable.js, there are two visible views, one is the current view, the other is the next view. This function returns the current view, not the next view, which has the mblIn class.

Parameter Type Description
node DomNode
Returns:undefined | null | DomNode
flashScrollBar()

Shows the scroll bar instantly.

This function shows the scroll bar, and then hides it 300ms later. This is used to show the scroll bar to the user for a short period of time when a hidden view is revealed.

get(name)
Defined by dijit/_WidgetBase

Get a property from a widget.

Get a named property from a widget. The property may potentially be retrieved via a getter method. If no getter is defined, this just retrieves the object's property.

For example, if the widget has properties foo and bar and a method named _getFooAttr(), calling: myWidget.get("foo") would be equivalent to calling widget._getFooAttr() and myWidget.get("bar") would be equivalent to the expression widget.bar2

Parameter Type Description
name undefined

The property to get.

Returns:undefined
getChildren()
Defined by dijit/_WidgetBase

Returns all direct children of this widget, i.e. all widgets underneath this.containerNode whose parent is this widget. Note that it does not return all descendants, but rather just direct children. Analogous to Node.childNodes, except containing widgets rather than DOMNodes.

The result intentionally excludes internally created widgets (a.k.a. supporting widgets) outside of this.containerNode.

Note that the array returned is a simple array. Application code should not assume existence of methods like forEach().

Returns:Array
getDim()

Returns various internal dimensional information needed for calculation.

Returns:object
getIndexInParent()
Defined by dijit/_Contained

Returns the index of this widget within its container parent. It returns -1 if the parent does not exist, or if the parent is not a dijit/_Container

Returns:number | undefined
getIndexOfChild(child)
Defined by dijit/_Container

Gets the index of the child in this container or -1 if not found

Parameter Type Description
child dijit/_WidgetBase
Returns:undefined
getNextSibling()
Defined by dijit/_Contained

Returns null if this is the last child of the parent, otherwise returns the next element sibling to the "right".

Returns:undefined
getParent()
Defined by dijit/_WidgetBase

Returns the parent widget of this widget.

Returns:undefined
getPos()

Gets the top position in the midst of animation.

Returns:object
getPreviousSibling()
Defined by dijit/_Contained

Returns null if this is the first child of the parent, otherwise returns the next element sibling to the "left".

Returns:undefined
getScreenSize()

Returns the dimensions of the browser window.

Returns:object
getShowingView()
Defined by dojox/mobile/View

Find the currently showing view from my sibling views.

Note that depending on the ancestor views' visibility, the found view may not be actually shown.

Returns:undefined | null
getSiblingViews()
Defined by dojox/mobile/View

Returns an array of the sibling views.

Returns:Array | undefined
getSpeed()

Returns an object that indicates the scrolling speed.

From the position and elapsed time information, calculates the scrolling speed, and returns an object with x and y.

Returns:object
goTo(dir,moveTo)

Moves to the next or previous view.

Parameter Type Description
dir Number
moveTo String
Optional
handleNextPage(w)

Called when the "/dojox/mobile/nextPage" topic is published.

Parameter Type Description
w Widget
handlePrevPage(w)

Called when the "/dojox/mobile/prevPage" topic is published.

Parameter Type Description
w Widget
hasChildren()
Defined by dijit/_Container

Returns true if widget has child widgets, i.e. if this.containerNode contains widgets.

Returns:boolean
hide()
Defined by dojox/mobile/View

Hides this view without a transition animation.

hideScrollBar()

Hides the scroll bar.

If the fadeScrollBar property is true, hides the scroll bar with the fade animation.

init(params)

Initialize according to the given params.

Mixes in the given params into this instance. At least domNode and containerNode have to be given. Starts listening to the touchstart events. Calls resize(), if this widget is a top level widget.

Parameter Type Description
params Object
Optional
invokeCallback()
Defined by dojox/mobile/View

A function to be called after performing a transition to call a specified callback.

isFocusable()
Defined by dijit/_WidgetBase

Return true if this widget can currently be focused and false if not

Returns:undefined
isFormElement(node)

Returns true if the given node is a form control.

Parameter Type Description
node DOMNode
Returns:boolean
isLeftToRight()
Defined by dijit/_WidgetBase

Return this widget's explicit or implicit orientation (true for LTR, false for RTL)

Returns:undefined
isSwapView(node)

Returns true if the given node is a SwapView widget.

Parameter Type Description
node DomNode
Returns:undefined
isTopLevel()

Returns true if this is a top-level widget.

Subclass may want to override.

Returns:boolean
isVisible(checkAncestors)
Defined by dojox/mobile/View

Return true if this view is visible

Parameter Type Description
checkAncestors Boolean
Optional

If true, in addition to its own visibility, also checks the ancestors visibility to see if the view is actually being shown or not.

Returns:boolean | undefined
makeTranslateStr(to)

Constructs a string value that is passed to the -webkit-transform property.

Return value example: "translate3d(0px,-8px,0px)"

Parameter Type Description
to Object

The destination position. An object with x and/or y.

Returns:string
nextView(node)

Returns the next view.

Parameter Type Description
node DomNode
Returns:undefined | null
on(type,func)
Defined by dijit/_WidgetBase

Call specified function when event occurs, ex: myWidget.on("click", function(){ ... }).

Call specified function when event type occurs, ex: myWidget.on("click", function(){ ... }). Note that the function is not run in any particular scope, so if (for example) you want it to run in the widget's scope you must do myWidget.on("click", lang.hitch(myWidget, func)).

Parameter Type Description
type String | Function

Name of event (ex: "click") or extension event like touch.press.

func Function
Returns:undefined
own()
Defined by dijit/Destroyable

Track specified handles and remove/destroy them when this instance is destroyed, unless they were already removed/destroyed manually.

Returns:any | undefined

The array of specified handles, so you can do for example:

var handle = this.own(on(...))[0];
performTransition(moveTo,transitionDir,transition,context,method)
Defined by dojox/mobile/View

Function to perform the various types of view transitions, such as fade, slide, and flip.

Parameter Type Description
moveTo String

The id of the transition destination view which resides in the current page. If the value has a hash sign ('#') before the id (e.g. #view1) and the dojo/hash module is loaded by the user application, the view transition updates the hash in the browser URL so that the user can bookmark the destination view. In this case, the user can also use the browser's back/forward button to navigate through the views in the browser history. If null, transitions to a blank view. If '#', returns immediately without transition.

transitionDir Number

The transition direction. If 1, transition forward. If -1, transition backward. For example, the slide transition slides the view from right to left when transitionDir == 1, and from left to right when transitionDir == -1.

transition String

A type of animated transition effect. You can choose from the standard transition types, "slide", "fade", "flip", or from the extended transition types, "cover", "coverv", "dissolve", "reveal", "revealv", "scaleIn", "scaleOut", "slidev", "swirl", "zoomIn", "zoomOut", "cube", and "swap". If "none" is specified, transition occurs immediately without animation.

context Object

The object that the callback function will receive as "this".

method String | Function

A callback function that is called when the transition has finished. A function reference, or name of a function in context.

Examples

Example 1

Transition backward to a view whose id is "foo" with the slide animation.

performTransition("foo", -1, "slide");

Example 2

Transition forward to a blank view, and then open another page.

performTransition(null, 1, "slide", null, function(){location.href = href;});
placeAt(reference,position)
Defined by dijit/_WidgetBase

Place this widget somewhere in the DOM based on standard domConstruct.place() conventions.

A convenience function provided in all _Widgets, providing a simple shorthand mechanism to put an existing (or newly created) Widget somewhere in the dom, and allow chaining.

Parameter Type Description
reference String | DomNode | DocumentFragment | dijit/_WidgetBase

Widget, DOMNode, DocumentFragment, or id of widget or DOMNode

position String | Int
Optional

If reference is a widget (or id of widget), and that widget has an ".addChild" method, it will be called passing this widget instance into that method, supplying the optional position index passed. In this case position (if specified) should be an integer.

If reference is a DOMNode (or id matching a DOMNode but not a widget), the position argument can be a numeric index or a string "first", "last", "before", or "after", same as dojo/dom-construct::place().

Returns:dijit/_WidgetBase | function

Provides a useful return of the newly created dijit._Widget instance so you can "chain" this function by instantiating, placing, then saving the return value to a variable.

Examples

Example 1

// create a Button with no srcNodeRef, and place it in the body:
var button = new Button({ label:"click" }).placeAt(win.body());
// now, 'button' is still the widget reference to the newly created button
button.on("click", function(e){ console.log('click'); }));

Example 2

// create a button out of a node with id="src" and append it to id="wrapper":
var button = new Button({},"src").placeAt("wrapper");

Example 3

// place a new button as the first element of some div
var button = new Button({ label:"click" }).placeAt("wrapper","first");

Example 4

// create a contentpane and add it to a TabContainer
var tc = dijit.byId("myTabs");
new ContentPane({ href:"foo.html", title:"Wow!" }).placeAt(tc)
postCreate()
Defined by dijit/_WidgetBase

Processing after the DOM fragment is created

Called after the DOM fragment has been created, but not necessarily added to the document. Do not include any operations which rely on node dimensions or placement.

postMixInProperties()
Defined by dijit/_WidgetBase

Called after the parameters to the widget have been read-in, but before the widget template is instantiated. Especially useful to set properties that are referenced in the widget template.

postscript(params,srcNodeRef)
Defined by dijit/_WidgetBase

Kicks off widget instantiation. See create() for details.

Parameter Type Description
params Object
Optional
srcNodeRef DomNode | String
previousView(node)

Returns the previous view.

Parameter Type Description
node DomNode
Returns:undefined | null
removeChild(widget)
Defined by dijit/_Container

Removes the passed widget instance from this widget but does not destroy it. You can also pass in an integer indicating the index within the container to remove (ie, removeChild(5) removes the sixth widget).

Parameter Type Description
widget Widget | int
removeCover()

Removes the transparent DIV cover.

resetScrollBar()

Resets the scroll bar length, position, etc.

resize()

Calls resize() of each child widget.

scrollIntoView(node,alignWithTop,duration)

Scrolls the pane until the searching node is in the view.

Just like the scrollIntoView method of DOM elements, this function causes the given node to scroll into view, aligning it either at the top or bottom of the pane.

Parameter Type Description
node DOMNode

A DOM node to be searched for view.

alignWithTop Boolean
Optional

If true, aligns the node at the top of the pane. If false, aligns the node at the bottom of the pane.

duration Number
Optional

Duration of scrolling in seconds. (ex. 0.3) If not specified, scrolls without animation.

scrollScrollBarTo(to)

Moves the scroll bar(s) to the given position without animation.

Parameter Type Description
to Object

The destination position. An object with x and/or y. ex. {x:2, y:5}, {y:20}, etc.

scrollTo(to)

Overrides dojox/mobile/scrollable.scrollTo().

Parameter Type Description
to Object
set(name,value)
Defined by dijit/_WidgetBase

Set a property on a widget

Sets named properties on a widget which may potentially be handled by a setter in the widget.

For example, if the widget has properties foo and bar and a method named _setFooAttr(), calling myWidget.set("foo", "Howdy!") would be equivalent to calling widget._setFooAttr("Howdy!") and myWidget.set("bar", 3) would be equivalent to the statement widget.bar = 3;

set() may also be called with a hash of name/value pairs, ex:

myWidget.set({
    foo: "Howdy",
    bar: 3
});

This is equivalent to calling set(foo, "Howdy") and set(bar, 3)

Parameter Type Description
name undefined

The property to set.

value undefined

The value to set in the property.

Returns:function | string

Set a property on a widget

setKeyframes(from,to,idx)

Programmatically sets key frames for the scroll animation.

Parameter Type Description
from Object
to Object
idx Number
setSelectable(node,selectable)

Sets the given node as selectable or unselectable.

Parameter Type Description
node DomNode
selectable Boolean
show(noEvent,doNotHideOthers)
Defined by dojox/mobile/View

Shows this view without a transition animation.

Parameter Type Description
noEvent Boolean
Optional
doNotHideOthers Boolean
Optional
showScrollBar()

Shows the scroll bar.

This function creates the scroll bar instance if it does not exist yet, and calls resetScrollBar() to reset its length and position.

slideScrollBarTo(to,duration,easing)

Moves the scroll bar(s) to the given position with the slide animation.

Parameter Type Description
to Object

The destination position. An object with x and y. ex. {x:0, y:-5}

duration Number

Duration of the animation in seconds. (ex. 0.3)

easing String

The name of easing effect which webkit supports. "ease", "linear", "ease-in", "ease-out", etc.

slideTo(to,duration,easing,fake_pos)

Overrides dojox/mobile/scrollable.slideTo().

Parameter Type Description
to Object
duration Number
easing String
fake_pos Object
Optional
startup()
stopAnimation()

Stops the currently running animation.

subscribe(t,method)
Defined by dijit/_WidgetBase

Deprecated, will be removed in 2.0, use this.own(topic.subscribe()) instead.

Subscribes to the specified topic and calls the specified method of this object and registers for unsubscribe() on widget destroy.

Provide widget-specific analog to dojo.subscribe, except with the implicit use of this widget as the target object.

Parameter Type Description
t String

The topic

method Function

The callback

Returns:undefined

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
toString()
Defined by dijit/_WidgetBase

Returns a string that represents the widget.

When a widget is cast to a string, this method will be used to generate the output. Currently, it does not implement any sort of reversible serialization.

Returns:string
uninitialize()
Defined by dijit/_WidgetBase

Deprecated. Override destroy() instead to implement custom widget tear-down behavior.

Returns:boolean
unsubscribe(handle)
Defined by dijit/_WidgetBase

Deprecated, will be removed in 2.0, use handle.remove() instead.

Unsubscribes handle created by this.subscribe. Also removes handle from this widget's list of subscriptions

Parameter Type Description
handle Object
watch(name,callback)
Defined by dojo/Stateful

Watches a property for changes

Parameter Type Description
name String
Optional

Indicates the property to watch. This is optional (the callback may be the only parameter), and if omitted, all the properties will be watched

callback Function

The function to execute when the property changes. This will be called after the property has been changed. The callback will be called with the |this| set to the instance, the first argument as the name of the property, the second argument as the old value and the third argument as the new value.

Returns:any | object

An object handle for the watch. The unwatch method of this object can be used to discontinue watching this property:

var watchHandle = obj.watch("foo", callback);
watchHandle.unwatch(); // callback won't be called now

Events

_onBlur()
Defined by: dijit/_FocusMixin

This is where widgets do processing for when they stop being active, such as changing CSS classes. See onBlur() for more details.

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
_onFocus()
Defined by: dijit/_FocusMixin

This is where widgets do processing for when they are active, such as changing CSS classes. See onFocus() for more details.

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
_onMap(type)
Defined by: dijit/_WidgetBase

Maps on() type parameter (ex: "mousemove") to method name (ex: "onMouseMove"). If type is a synthetic event like touch.press then returns undefined.

Parameter Type Description
type String | Function
Returns:undefined

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onAfterScroll(e)

called after a scroll has been performed.

Parameter Type Description
e Event

the scroll event, that contains the following attributes: x (x coordinate of the scroll destination), y (y coordinate of the scroll destination), beforeTop (a boolean that is true if the scroll detination is before the top of the scrollable), beforeTopHeight (the number of pixels before the top of the scrollable for the scroll destination), afterBottom (a boolean that is true if the scroll destination is after the bottom of the scrollable), afterBottomHeight (the number of pixels after the bottom of the scrollable for the scroll destination)

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onAfterTransitionIn(moveTo,dir,transition,context,method)
Defined by: dojox/mobile/View

Stub function to connect to from your application.

Called after the arriving transition occurs.

Parameter Type Description
moveTo undefined
dir undefined
transition undefined
context undefined
method undefined

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onAfterTransitionOut(moveTo,dir,transition,context,method)
Defined by: dojox/mobile/View

Stub function to connect to from your application.

Called after the leaving transition occurs.

Parameter Type Description
moveTo undefined
dir undefined
transition undefined
context undefined
method undefined

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onAnimationEnd(e)
Defined by: dojox/mobile/SwapView
Parameter Type Description
e Event

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onAnimationStart(e)
Defined by: dojox/mobile/View

A handler that is called when transition animation starts.

Parameter Type Description
e undefined

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onBeforeScroll(e)

called before a scroll is initiated. If this method returns false, the scroll is canceled.

Parameter Type Description
e Event

the scroll event, that contains the following attributes: x (x coordinate of the scroll destination), y (y coordinate of the scroll destination), beforeTop (a boolean that is true if the scroll detination is before the top of the scrollable), beforeTopHeight (the number of pixels before the top of the scrollable for the scroll destination), afterBottom (a boolean that is true if the scroll destination is after the bottom of the scrollable), afterBottomHeight (the number of pixels after the bottom of the scrollable for the scroll destination)

Returns:boolean

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onBeforeTransitionIn(moveTo,dir,transition,context,method)
Defined by: dojox/mobile/View

Stub function to connect to from your application.

Called before the arriving transition occurs.

Parameter Type Description
moveTo undefined
dir undefined
transition undefined
context undefined
method undefined

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onBeforeTransitionOut(moveTo,dir,transition,context,method)
Defined by: dojox/mobile/View

Stub function to connect to from your application.

Called before the leaving transition occurs.

Parameter Type Description
moveTo undefined
dir undefined
transition undefined
context undefined
method undefined

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onBlur()
Defined by: dijit/_FocusMixin

Called when the widget stops being "active" because focus moved to something outside of it, or the user clicked somewhere outside of it, or the widget was hidden.

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onFlickAnimationEnd(e)
Defined by: dojox/mobile/SwapView
Parameter Type Description
e Event

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onFlickAnimationStart(e)
Parameter Type Description
e undefined

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onFocus()
Defined by: dijit/_FocusMixin

Called when the widget becomes "active" because it or a widget inside of it either has focus, or has recently been clicked.

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onStartView()
Defined by: dojox/mobile/View

Stub function to connect to from your application.

Called only when this view is shown at startup time.

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onTouchEnd(e)
Defined by: dojox/mobile/SwapView
Parameter Type Description
e Event

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onTouchMove(e)

User-defined function to handle touchMove events.

Parameter Type Description
e undefined

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onTouchStart(e)
Defined by: dojox/mobile/SwapView

Internal function to handle touchStart events.

Parameter Type Description
e Event

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
Error in the documentation? Can’t find what you are looking for? Let us know!