July 2015
Beginner
452 pages
8h 34m
English
There are times when we need to create a menu (or menus) to allow the user to choose from the available options. We can achieve this by setting the menu property of the buttons. This will create a floating menu for the selected button, and it will be shown when the user clicks on the button.
Let's create a button that contains a menu with options. For the following example, we need to create an HTML page, import the Ext JS library, and listen for the DOM ready event. Inside the callback, we should modify the code that creates our button, as shown here:
var myButton = Ext.create('Ext.button.Button',{
text:'Add payment method...',
iconCls:'addicon-32',
iconAlign:'left',
scale:'large',
renderTo:'normalbuttons',
menu:[
{text:'Master ...Read now
Unlock full access