-
Notifications
You must be signed in to change notification settings - Fork 15
Navigation_Push
This function is part of the navigate functions to switch between views in a Cobalt application.
cobalt.navigate.push(options) create a new page and push it in front of the user. On Android, a new Activity is started. On iOS, the new view slides-in from the right of the screen.
options may contains the folowing :
-
page (required) is the html page you want to load from the root web folder. This parameter is required for the "push" and "modal" types.
-
controller is the name of the view you want to load. This view should be defined in the cobalt.json file. Default to a Cobalt controller.
-
data Optionnal data to send to the next page. The next page will receive this data in the cobalt:onPageShown message.
-
animated : Define if the page transition should be animated or not. Default to true.
//push next.html in a default controller
cobalt.navigate.push({ page : "next.html" });
//push next.html in MyCustomControllerName controller with no animation.
cobalt.navigate.push({ page : "next.html", controller:"myController", animated:false });
//push next.html and send it a data object
cobalt.navigate.push({ page : "next.html", data :{ hip : "hop" }})
Cobalt is an Open-Source Hybrid Mobile Framework. Read more about it on the home page or in the documentation
- Introduction to Cobalt navigation
- The cobalt.json file
- native navigation bars
- Handling the Android back button
- Introduction to Cobalt messages
- Publish/Subscribe on the Web side
- Publish/Subscribe on Android
- Publish/Subscribe on iOS
- Web Lifecycle messages
- Pull-To-Refresh and Infinite Scroll
- Custom alerts and Toasts
- LocalStorage
- OpenExternalUrl
- PlatformInfos
- Ajax
- Removing the top bar
- Adding Cobalt to an existing project
- Customizing your hybrid views
- Handle multiple Cobalt webviews on the same screen (TODO)