-
Notifications
You must be signed in to change notification settings - Fork 15
Alerts
Guillaume Gendre edited this page Jan 17, 2014
·
10 revisions
We think that asking something simple to the user should be simple and shown in a way the user is used to see.
So basic alerts should be shown the native way. No "pop-in" shit ;)
We added in Cobalt a way to show alerts to the users : set a title and a text, adds some button and let see what the user is wanting !
TODO
Examples
cobalt.alert("Texte");
cobalt.alert("Title", "Texte", ["Ok"], { callback:function(data){ cobalt.log('popup dismissed' +data.index) }});
cobalt.alert("Title", "Texte", ["Ok"], { callback:"app.popupDismissed", cancelable : true });
This is the message sent to native side to show an alert.
{
type: "ui",
control: "alert",
data: {
title: "myTitle",
message: "myMessage",
buttons: [
"myFirstButtonText",
"mySecondOptionalButtonText",
...
],
cancelable: true | false
},
callback: "myOptionalCallback"
}
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)