Let's get back to making our little application as annoying as possible by adding an icon and buttons! This can be done by adding a style for the icon, and modifying the config
to have an icon
record along with a buttons
record.
First, let's discuss the CSS we need. Add the following code into the head of the document, within a style tag:
.milton-icon { background: url(milton-head-icon.png) no-repeat; }
Also, we will make some changes to our widgets configuration. The icon
record just needs our style name as the value, milton-icon
. We have also included a function to be executed when a user clicks on any of the buttons in the dialog. This function is created as an anonymous function, and in this case, it is merely used to pass variables:
Ext.Msg.show({ title: 'Milton', msg: 'Have you seen my stapler?', buttons: { yes: true, no: true, cancel: true }, icon: 'milton-icon', fn: function(btn) { Ext.Msg.alert('You Clicked', btn...