1.0.1 • Published 8 years ago
cordova-plugin-dialog-list v1.0.1
cordova-plugin-dialog-list
This is a cordova plugin which allows you to display a Native Dialog List on Android.
NOTE: You must wait for the deviceready
event.
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(device.cordova);
}
Installation
cordova plugin add cordova-plugin-dialog-list
phonegap plugin add cordova-plugin-dialog-list
Usage
cordova.plugins.dialogList(success, error, title, array);
success - Success callback function, which returns index of the clicked list item.
error - Error callback function, which returns Error String
title - String for the Title of the Dialog List
array - Array of Strings which will be used as List in the Dialog
Example
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
cordova.plugins.dialogList(function(index){
//index of the clicked item
console.log(index);
}, function(error){
console.log(error);
}, "Dialog Title", ["Item 1", "Item 2", "Item 3"]);
}
Supported Platforms
- Android