-
Notifications
You must be signed in to change notification settings - Fork 14
Navigation_Pop
This function is part of the navigate functions to switch between views in a Cobalt application.
With cobalt.navigate.pop(options), the current view is closed and Cobalt comes back to the latest page in the current navigation. On iOS, there is a slide back transition and on Android, the activity is closed.
options is an optionnal object parameter that may contains the folowing keys:
-
data (optionnal) data to send back to the previous page. The previous page will receive this data in the cobalt:onPageShown message.
-
page (optionnal) is the html page on which you want to go back. Cobalt will go backward and stop on the first matching couple of
page
andcontroller
it found. -
controller (optionnal) is the name of the view on which you want to go back. This view should be defined in the cobalt.json file. Default to any Cobalt controller.
//pop the previous page
cobalt.navigate.pop();
//pop the previous page with some data
// previous page will receive {foo: 'bar'} in onPageShown data.
cobalt.navigate.pop({ data: { foo: 'bar'}});
//pop to the previous index page with controller myController
cobalt.navigate.popTo({ page : "index.html", controller:"myController" });
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)