dojox/mobile/ScreenSizeAware (version 1.10)

Summary

A module to make a screen size aware application.

This module helps for creating applications that transform their UI layout according to the screen size. It assumes that the application consists of two horizontally split panes, and the left pane has a list widget. If you require this module in such an application, in a tablet-sized screen, the application shows a horizontally split view whose left pane is a list widget. In a phone-sized screen, the application shows a list widget that fills the screen.

Usage

var foo = new ScreenSizeAware(options);
dojox/mobile/ScreenSizeAware
Parameter Type Description
options Object
Optional

Contains properties to be set.

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

Examples

Example 1

<span data-dojo-type="dojox.mobile.ScreenSizeAware"></span>
<div data-dojo-type="dojox.mobile.FixedSplitter" data-dojo-props='orientation:"H"'>
  <div data-dojo-type="dojox.mobile.Container" style="width:300px;">
    <div id="leftView" data-dojo-type="dojox.mobile.ScrollableView">
      <h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='fixed:"top"'>Left Pane</h1>
      <ul data-dojo-type="dojox.mobile.EdgeToEdgeList" data-dojo-props='stateful:true'>
        <li data-dojo-type="dojox.mobile.ListItem" data-dojo-props='label:"View1", moveTo:"view1"'></li>
        ....
      </ul>
    </div>
  </div>
  <div data-dojo-type="dojox.mobile.Container">
    <div id="view1" data-dojo-type="dojox.mobile.ScrollableView">
      <h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='fixed:"top", back:"Home", moveTo:"leftView"'>Right Pane</h1>
      ....
    </div>
  </div>
</div>

Property Summary

Method Summary

Properties

_instance
leftListId

The id of the list widget in the left view.

leftPaneId

The id of the left pane.

leftViewId

The id of the left View.

rightPaneId

The id of the right pane.

splitterId

The id of the FixedSplitter.

Methods

getDestinationId(item)

Returns the id of the target view of the given item.

Parameter Type Description
item undefined
Returns:undefined
getInstance()
getShowingView()

Returns the view currently shown.

Returns:null | undefined
init()

Initializes the application.

isPhone()

Returns true if the current mode set by transformUI(mode) is "phone".

Returns:boolean
leftItemSelected(e)

Function called when an item in the left-side list is selected.

Parameter Type Description
e Event
moveList()

Places the list widget. If the current mode is "phone", it places the list widget in the right pane, otherwise in the left pane.

showLeftView()

Shows the left-side view.

showRightView()

Shows the right-side view.

transformUI(mode)

Applies an UI mode.

Parameter Type Description
mode String

If this argument is "phone", sets the UI in phone mode, otherwise in tablet mode.

updateBackButton()

Updates the back button.

updateSelectedItem()

Updates the selected item.

updateStateful()

Updates the stateful property of the list widget in the left-side pane.

updateTransition()

Updates the transition property of the items in the left-side widget.

Error in the documentation? Can’t find what you are looking for? Let us know!