A singleton class that controls view transition.
This class listens to the "startTransition" events and performs view transitions. If the transition destination is an external view specified with the url parameter, the view content is retrieved and parsed to create a new target view.
See the dojox/mobile/ViewController reference documentation for more information.
The data handler class used to load external views, by default "dojox/mobile/dh/DataHandler" (see the Data Handlers page in the reference documentation).
The data source class used to load external views, by default "dojox/mobile/dh/UrlDataSource" (see the Data Handlers page in the reference documentation).
The file type map class used to load external views, by default "dojox/mobile/dh/SuffixFileTypeMap" (see the Data Handlers page in the reference documentation).
Parses the moveTo argument and determines a starting view and a destination view.
Parameter | Type | Description |
---|---|---|
moveTo | String |
An array containing the currently showing view, the destination view and the transition parameters, or an empty array if the moveTo argument could not be parsed.
Loads an external view and performs a transition to it.
This method loads external view content through the dojox/mobile data handlers, creates a new View instance with the loaded content, and performs a view transition to the new view. The external view content can be specified with the url property of transOpts. The new view is created under a DOM node specified by target.
Parameter | Type | Description |
---|---|---|
transOpts | Object | |
target | DomNode |
Deferred object that resolves when the external view is ready and a transition starts. Note that it resolves before the transition is complete.
This example loads view1.html, creates a new view under
<body>
, and performs a transition to the new view with the
slide animation.
var vc = ViewController.getInstance(); vc.openExternalView({ url: "view1.html", transition: "slide" }, win.body());
If you want to perform a view transition without animation, you can give transition:"none" to transOpts.
var vc = ViewController.getInstance(); vc.openExternalView({ url: "view1.html", transition: "none" }, win.body());
If you want to dynamically create an external view, but do not want to perform a view transition to it, you can give noTransition:true to transOpts. This may be useful when you want to preload external views before the user starts using them.
var vc = ViewController.getInstance(); vc.openExternalView({ url: "view1.html", noTransition: true }, win.body());
To do something when the external view is ready:
var vc = ViewController.getInstance(); Deferred.when(vc.openExternalView({...}, win.body()), function(){ doSomething(); });
A handler that performs view transition.
Parameter | Type | Description |
---|---|---|
evt | undefined |
This example loads view1.html, creates a new view under
<body>
, and performs a transition to the new view with the
slide animation.
var vc = ViewController.getInstance(); vc.openExternalView({ url: "view1.html", transition: "slide" }, win.body());
If you want to perform a view transition without animation, you can give transition:"none" to transOpts.
var vc = ViewController.getInstance(); vc.openExternalView({ url: "view1.html", transition: "none" }, win.body());
If you want to dynamically create an external view, but do not want to perform a view transition to it, you can give noTransition:true to transOpts. This may be useful when you want to preload external views before the user starts using them.
var vc = ViewController.getInstance(); vc.openExternalView({ url: "view1.html", noTransition: true }, win.body());
To do something when the external view is ready:
var vc = ViewController.getInstance(); Deferred.when(vc.openExternalView({...}, win.body()), function(){ doSomething(); });