Menu

Introduction

This sample exemplifies how to use the <menu> and <option> components in JavaScript. The <option> component can serve as a subcomponent of the <menu> and <select> components. You can define component attributes such as its position, style, and events to respond.

You can also define the menu options that display when a component is clicked so that users can select them to perform respective operations.

Usage

  1. Click Menu option to display the Menu option screen. On this screen, the <option> sub-components of <menu> show the Dishes, Snack, and Drink options. Click an option text box to bring up the respective menu and select an option. The selected options are displayed in menu details at the bottom. Click Submit Order to submit the order. A success message will be displayed, and the order details will be cleared. To clear the order details, click Clear Order.

  2. Click Select option to display the Select option screen. On this screen, the <option> sub-components of <select> show the Dishes, Snack, and Drink options. Click an option text box to bring up the respective menu and select an option. The selected options are displayed in menu details at the bottom. Click Submit Order to submit the order. A success message will be displayed, and the order details will be cleared. To clear the order details, click Clear Order.

Constraints

This sample can only be run on standard-system devices.