Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

The Options List feature enables you to display options as a list in your mobile application.

Supported Platforms

This feature is supported in the following platforms:

  • iOS
  • Android

Installation

Execute the following command in your Cordova project directory:

cordova plugin add cordova-plugin-listpicker

Usage

// This function displays an options list for the user to choose from the available options.
this.fm.registerHandler("cbxclick", "LIST_POPUP", 
                        function (fm, event, fieldName, value) 
						{
            				var config = 
							{
                				title: "Select a Loan",
								items: 
								[{
                        			text: "Personal Loan",
									value: "personal loan"
                    			 },
								 {
                        			text: "Home Loan",
									value: "home loan"
                    			 },
								 {
                        			text: "Four-wheeler Loan",
									value: "fourwheeler loan"
                    			 },
								 {
                        			text: "Gold Loan",
									value: "gold loan"
                    			 },
                    			 {
                        			text: "Two-wheeler Loan",
									value: "twowheeler loan"
                    			 }],
								
								selectedValue: "fourwheeler loan",
								doneButtonLabel: "Done",
								cancelButtonLabel: "Cancel"
            				};
            				canvas.env.listPicker.showPicker(config, ListPickerSuccess, ListPickerError);
});

// This function is called when a value from the options list is successfully selected.
function ListPickerSuccess(item) 
{
    showAlert("You have selected " + item);
}

// This function is called when a value from the options list is not selected.
function ListPickerError(err) 
{
    showAlert("You have cancelled");
}

  • No labels